Hi. I am new in VB .Net, i have use VB6 untile now. Now i am using VB .Net 2005. I am trying to rewrite a program from VB6. How do i extract the MAC address of a remote computer knowing its name and IP? Thank you! :confused:
Printable View
Hi. I am new in VB .Net, i have use VB6 untile now. Now i am using VB .Net 2005. I am trying to rewrite a program from VB6. How do i extract the MAC address of a remote computer knowing its name and IP? Thank you! :confused:
Is this a computer on the same network or a different network?
Thank you for your reply. Same network.Quote:
Originally Posted by dbasnett
You should be able to use WMI to query the remote hosts for information about its NICs, and get its MAC addresses that way.
The Address Resolution Protocol (ARP) is what all computers and routers today use to retrieve other hosts MAC addresses. Using the ARP protocol directly on a host might be another approach.
Thank you for your reply. I am new with VB .Net. I have no idea how to do it.Quote:
Originally Posted by Atheist
here is a link with wmi, but that assumes that the other computer is windows based.
http://forums.microsoft.com/MSDN/Sho...84212&SiteID=1
why not run dos commands from vb, ping the computer, then
arp -a
and parse the output.
process.start
here is a link for the Process class
http://msdn.microsoft.com/en-us/libr...rs(VS.85).aspx
Thank you. I have adjusted it a little because i was getting some errors.
here it is:
Code:Dim ComputerName As String
ComputerName = "test"
Dim theManagementScope As New Management.ManagementScope("\\" & ComputerName & "\root\cimv2")
Dim theQueryString As String
theQueryString = "SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = 1 "
Dim theObjectQuery As New Management.ObjectQuery(theQueryString)
Dim theSearcher As New Management.ManagementObjectSearcher(theManagementScope, theObjectQuery)
Dim theResultsCollection As Management.ManagementObjectCollection = theSearcher.Get()
For Each currentResult As Management.ManagementObject In theResultsCollection
MessageBox.Show(currentResult("MacAddress").ToString())
Next
Good to see you succeeded. Im in the middle of writing a DLL for you to send ARPs to other hosts, I'll finish it and post it here in case any one else is interested.
Hi all
help me
please anyone help me code or program vb6 to get MAC address from remote client with use vb6 please help me
your friends Habbeb send code or program on my email :[email protected]
thank you ...thank you
iphlpapi.dll