Click here to Skip to main content
15,895,011 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: sending Email Attachments Pin
Bob Beaubien9-Sep-09 9:20
Bob Beaubien9-Sep-09 9:20 
GeneralRe: sending Email Attachments Pin
Nuri Ismail9-Sep-09 10:32
Nuri Ismail9-Sep-09 10:32 
GeneralRe: sending Email Attachments Pin
Bob Beaubien9-Sep-09 10:56
Bob Beaubien9-Sep-09 10:56 
GeneralRe: sending Email Attachments Pin
Bob Beaubien9-Sep-09 18:45
Bob Beaubien9-Sep-09 18:45 
QuestionReading bits in VB.net Pin
xx77abs9-Sep-09 4:06
xx77abs9-Sep-09 4:06 
AnswerRe: Reading bits in VB.net Pin
EliottA9-Sep-09 4:13
EliottA9-Sep-09 4:13 
GeneralRe: Reading bits in VB.net Pin
xx77abs9-Sep-09 4:17
xx77abs9-Sep-09 4:17 
QuestionGet username of a PC [SOLVED] Pin
vijay24829-Sep-09 3:37
vijay24829-Sep-09 3:37 
Hi all,

I have two queries, which I have solved halfway.
First Query:
I want to find the Username who has logged on to a Computer, the computers IP address and Hostname.
I have written the code to find the Hostname and IP address but not the Username.
I would like all these information on a file, which I have already done except for the Username.
Code sofar:
Private Sub LogOutput_IP(ByVal logFile As String, ByVal msg As String)
        Using sw As StreamWriter = New StreamWriter(logFile, True)
            Dim theDate As Date = Now()
            Dim strHostName As String
            Dim strIPAddress As String

            strHostName = System.Net.Dns.GetHostName()
            strIPAddress = System.Net.Dns.GetHostEntry(strHostName).AddressList(0).ToString()
            Dim sb As StringBuilder = New StringBuilder(theDate.ToString)
            sb.Append(vbTab & msg)
            sb.Append(vbTab & "Host Name: " & strHostName)
            sb.Append(vbTab & " IP Address: " & strIPAddress)
            sw.WriteLine(sb.ToString)
        End Using
    End Sub

I call this sub in a button click event and works fine.
Output obtained:


I want help to write the Username who is currently using the Computer.

Second Query:
As of now The LP.txt file is created in a folder in C drive.
I wish to create this file in a server or another PC(say admins computer), how to achieve this?

Any help will be helpful.
Thanks in Advance.

modified on Tuesday, September 15, 2009 7:54 AM


modified 28-Nov-12 8:01am.

AnswerRe: Get username of a PC Pin
Nuri Ismail9-Sep-09 4:01
Nuri Ismail9-Sep-09 4:01 
GeneralRe: Get username of a PC Pin
vijay24829-Sep-09 4:17
vijay24829-Sep-09 4:17 
AnswerRe: Get username of a PC [About the second query] Pin
Nuri Ismail9-Sep-09 4:14
Nuri Ismail9-Sep-09 4:14 
GeneralRe: Get username of a PC [About the second query] Pin
vijay24829-Sep-09 4:20
vijay24829-Sep-09 4:20 
GeneralRe: Get username of a PC [About the second query] Pin
Nuri Ismail9-Sep-09 5:04
Nuri Ismail9-Sep-09 5:04 
GeneralRe: Get username of a PC [About the second query] Pin
vijay24829-Sep-09 5:08
vijay24829-Sep-09 5:08 
QuestionBeginner Pin
PCS3059-Sep-09 3:08
PCS3059-Sep-09 3:08 
AnswerCheck out MSDN for learning VB development Pin
David Mujica9-Sep-09 3:16
David Mujica9-Sep-09 3:16 
AnswerRe: Beginner Pin
Steven J Jowett9-Sep-09 3:18
Steven J Jowett9-Sep-09 3:18 
GeneralRe: Beginner Pin
EliottA9-Sep-09 3:37
EliottA9-Sep-09 3:37 
GeneralRe: Beginner Pin
Steven J Jowett9-Sep-09 4:28
Steven J Jowett9-Sep-09 4:28 
GeneralRe: Beginner Pin
PCS30510-Sep-09 1:57
PCS30510-Sep-09 1:57 
Questionhow to create dynamic pie charts in vb.net Pin
vidhish8-Sep-09 21:37
vidhish8-Sep-09 21:37 
AnswerRe: how to create dynamic pie charts in vb.net Pin
Christian Graus8-Sep-09 22:26
protectorChristian Graus8-Sep-09 22:26 
AnswerRe: how to create dynamic pie charts in vb.net Pin
0x3c09-Sep-09 0:36
0x3c09-Sep-09 0:36 
Questionplz help me to join multiple table query.... Pin
roopali gupta8-Sep-09 20:33
roopali gupta8-Sep-09 20:33 
AnswerRe: plz help me to join multiple table query.... Pin
_Damian S_8-Sep-09 20:38
professional_Damian S_8-Sep-09 20:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.