+92 332 4229 857 99ProjectIdeas@Gmail.com

Getting Your Admin Name And IP Address (Vb.net)



The following code shows you how to get your computer/admin name and how to get the ip address of your own computer.








Imports System.Net

Try

   Dim hostName = Dns.GetHostName()
   Dim hostEntry As IPHostEntry = Dns.GetHostByName(hostName)
   Dim ipAddress As IPAddress() = hostEntry.AddressList

   Console.Write("My Admin Name Is : " & Environment.UserName)

   For i = 0 To ipAddress.Length - 1

       Console.Write("My Ip Address Is : " & ipAddress(i).ToString())

   Next
 
Catch ex As Exception

      MsgBox(ex.Message)

End Try






0 comments: