Private Function IPAddress() As String
Dim strIP As String = ""
Dim LocalHostName As String
Try
LocalHostName = Dns.GetHostName() 'Here u will get ur system Name
Dim ipEnter As IPHostEntry = Dns.GetHostEntry(LocalHostName)
Dim IpAdd() As IPAddress = ipEnter.AddressList
strIP = IpAdd(0).ToString()
Return strIP 'It will return ipaddress of ur system
Catch ex As Exception
Throw New Exception(ex.Message)
End Try
End Function
and add namespace:
Imports System.Net