Hitmanpt Posted March 21, 2012 Report Share Posted March 21, 2012 Boas pessoal, eu tenho andado a tentar obter o endereço de IP para cada placa de rede mas não tenho tido sucesso 😉 Aqui está o meu código Dim iface As NetworkInterface() = GetAllInterfaces() Dim i As Integer = 0 For Each Str As NetworkInterface In iface Dim itm As New ListViewItem(i) itm.SubItems.Add(Str.Name) itm.SubItems.Add(Str.Description) itm.SubItems.Add(Str.GetIPProperties().UnicastAddresses(0).Address.ToString) ListView1.Items.Add(itm) i = i + 1 Next Prece-me estar tudo OK mas na parte dos IP's aparece-me isto http://hitman-pt.zzl.org/help/Untitled.png Link to comment Share on other sites More sharing options...
José Lopes Posted March 21, 2012 Report Share Posted March 21, 2012 Sacar IP's Public Function GetIp() As String Try Dim IPList As System.Net.IPHostEntry = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName) Dim IP As IPAddress For Each IP In IPList.AddressList 'Only return IPv4 routable IPs If (IP.AddressFamily = Sockets.AddressFamily.InterNetwork) Then Return IP.ToString End If Next Return "" Catch ex As Exception End Try End Function depois e so representares.... EDIT: GeSHi adicionado Quando te pedirem peixe.... ensina-os a Pescar!!Hum..lálálálá!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now