Fetching machine usernames using VB.NET
-
Given below is a code which will extract information about your machine from the DNS database and display it on your vb form: Dim oAddr As System.Net.IPAddress Dim Machine, ipaddress As String With System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName()) oAddr = New System.Net.IPAddress(.AddressList(0).Address) Machine = System.Net.Dns.GetHostName() ipaddress = oAddr.ToString() ipaddr.Text = ipaddress macname.Text = Machine The above code extracts the machines ip address and machine name and displays it in your form.Now i am looking for a code which can extract the username and group name of the person logged in on that machine.Could anybody help
-
Given below is a code which will extract information about your machine from the DNS database and display it on your vb form: Dim oAddr As System.Net.IPAddress Dim Machine, ipaddress As String With System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName()) oAddr = New System.Net.IPAddress(.AddressList(0).Address) Machine = System.Net.Dns.GetHostName() ipaddress = oAddr.ToString() ipaddr.Text = ipaddress macname.Text = Machine The above code extracts the machines ip address and machine name and displays it in your form.Now i am looking for a code which can extract the username and group name of the person logged in on that machine.Could anybody help
-
bhaps you should start with the System.Windows.Forms.SystemInformation class I think this is what you are looking for. Hmm...
Hi Lasse, Thanks for the information, SystemInformation class has all the adequate methods which let me fetch the machines info,although what i want here is :- Machine username and also Group name. How do i fetch a usergroup name?