Hello
I've 4 nic's in my pc, and through the code beloew I'm able to get mac
address of the nic that I want. now how do I get the IP address of that
NIC?
Dim MacAddress As String
Dim scope As ManagementScope = New
ManagementScope (ManagementPath .DefaultPath)
Dim query As SelectQuery = New
SelectQuery("Wi n32_NetworkAdap terConfiguratio n")
' this query returns all properties of the class
Dim searcher As ManagementObjec tSearcher = New
ManagementObjec tSearcher(scope , query)
Dim mo As New ManagementObjec t
For Each mo In searcher.Get()
If (mo.Item("Capti on").ToString ) = "[00000016] Packet Scheduler
Miniport" Then
Try
MacAddress = (mo.Item("MacAd dress").ToStrin g)
Me.RichTextBox1 .Text &= "Mac Address: " & MacAttack &
vbCrLf
Catch ex As Exception
End Try
End If
Next
Thanks
I've 4 nic's in my pc, and through the code beloew I'm able to get mac
address of the nic that I want. now how do I get the IP address of that
NIC?
Dim MacAddress As String
Dim scope As ManagementScope = New
ManagementScope (ManagementPath .DefaultPath)
Dim query As SelectQuery = New
SelectQuery("Wi n32_NetworkAdap terConfiguratio n")
' this query returns all properties of the class
Dim searcher As ManagementObjec tSearcher = New
ManagementObjec tSearcher(scope , query)
Dim mo As New ManagementObjec t
For Each mo In searcher.Get()
If (mo.Item("Capti on").ToString ) = "[00000016] Packet Scheduler
Miniport" Then
Try
MacAddress = (mo.Item("MacAd dress").ToStrin g)
Me.RichTextBox1 .Text &= "Mac Address: " & MacAttack &
vbCrLf
Catch ex As Exception
End Try
End If
Next
Thanks
Comment