-
Aug 19th, 2008, 05:42 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Extract the MAC address of a remote computer
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!
Last edited by alexia_net; Aug 19th, 2008 at 06:46 AM.
-
Aug 19th, 2008, 07:35 AM
#2
Re: Extract the MAC address of a remote computer
Is this a computer on the same network or a different network?
-
Aug 19th, 2008, 07:53 AM
#3
Thread Starter
Addicted Member
Re: Extract the MAC address of a remote computer
Originally Posted by dbasnett
Is this a computer on the same network or a different network?
Thank you for your reply. Same network.
-
Aug 19th, 2008, 08:07 AM
#4
Re: Extract the MAC address of a remote computer
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.
-
Aug 19th, 2008, 08:09 AM
#5
Thread Starter
Addicted Member
Re: Extract the MAC address of a remote computer
Originally Posted by Atheist
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.
-
Aug 19th, 2008, 08:14 AM
#6
Re: Extract the MAC address of a remote computer
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
-
Aug 19th, 2008, 08:23 AM
#7
Re: Extract the MAC address of a remote computer
Last edited by dbasnett; Aug 19th, 2008 at 11:47 AM.
-
Aug 19th, 2008, 08:39 AM
#8
Thread Starter
Addicted Member
Re: Extract the MAC address of a remote computer
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
-
Aug 19th, 2008, 08:49 AM
#9
Re: Extract the MAC address of a remote computer
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.
-
Oct 6th, 2008, 08:04 AM
#10
New Member
Re: [RESOLVED] Extract the MAC address of a remote computer
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 :friendoflove25@yahoo.com
thank you ...thank you
-
Oct 6th, 2008, 10:15 AM
#11
Re: [RESOLVED] Extract the MAC address of a remote computer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|