HTML

html content help to improve the coding

Saturday, 21 April 2012

How do I get a computer's name and IP address using VB.NET?


Private Sub GetIPAddress()
Dim strHostName As String
Dim strIPAddress As String



strHostName = System.Net.Dns.GetHostName()

strIPAddress = System.Net.Dns.GetHostByName(strHostName).AddressList(0).ToString()


MessageBox.Show("Host Name: " & strHostName & "; IP Address: " & strIPAddress)
End Sub

No comments:

Post a Comment