Hi
I agree Terry's suggestion, here I provide the code snippet for your
reference.
'NOTE: You need add reference to System.Management.dll first.
Dim mc As System.Management.ManagementClass
Dim mo As ManagementObject
mc = New ManagementClass("Win32_NetworkAdapterConfiguration")
Dim moc As ManagementObjectCollection = mc.GetInstances()
For Each mo In moc
If mo.Item("IPEnabled") = True Then
Debug.WriteLine("Network Adapter MAC address " &
mo.Item("MacAddress").ToString())
Debug.WriteLine("Gateway(Rounter): ")
Dim ss() As String = mo.Item("DefaultIpGateway")
For Each s As String In ss
Debug.WriteLine(" " + s)
Next
End If
Next
You may have a try, and if you have other concern, please feel free to let
me know.
Best regards,
Peter Huang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.