VB.Net/Network Remote/IP Address

Материал из VB Эксперт
Перейти к: навигация, поиск

Get your IP address

  
Public Class MainClass
    Public Shared Sub Main()
        Dim objEntry As System.Net.IPHostEntry = System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName)
        Dim strIP As String = CType(objEntry.AddressList.GetValue(0), System.Net.IPAddress).ToString
        System.Console.WriteLine(strIP)
    End Sub
End Class