Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ip As String
Dim myPinger As New OpenNETCF.Net.NetworkInformation.Ping
For Each interf As OpenNETCF.Net.NetworkInformation.NetworkInterface In OpenNETCF.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces
For Each gate_ip_info As OpenNETCF.Net.NetworkInformation.GatewayIPAddressInformation In interf.GetIPProperties.GatewayAddresses
TextBox1.Text = TextBox1.Text & "ip-adresse :" & gate_ip_info.Address.ToString & vbCrLf
ip = gate_ip_info.Address.ToString
Dim res() As OpenNETCF.Net.NetworkResource
Try
res = OpenNETCF.Net.Network.GetNetworkResources("\\" & System.Net.Dns.GetHostEntry(ip).HostName & Chr(0))
Catch ex As Exception
End Try
For Each arp As OpenNETCF.Net.NetworkInformation.ArpEntry In OpenNETCF.Net.NetworkInformation.ArpTable.GetArpTable
If ip = arp.IPAddress.ToString Then
TextBox1.Text = TextBox1.Text & "mac-adresse :" & arp.PhysicalAddress.ToString & vbCrLf
End If
Next
Next
Next
End Sub