Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > Pro VB.NET 2002/2003
|
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 6th, 2005, 03:25 AM
Registered User
 
Join Date: Apr 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to mistrypremal
Default classes for retriving MAC address in VB .NET

hi,

it would be great if anyone could help me out in solving this problem
I am developing an application which requires to find the MAC address of the
REMOTE computer.

I was wondering if there are any in-built classes in VB .NET to find the MAC address.

Thank You.

 
Old August 8th, 2007, 01:06 PM
Registered User
 
Join Date: Aug 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am trying to do the same thing on .NET

Did anyone have any luck at all pulling this off? I am currently doing this in .NET 1.1 but may upgrade to 2.0 in the near future.

Any help would be much appreciated!
 
Old August 8th, 2007, 07:27 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Quote:
quote:Originally posted by vincentjrg
 I am trying to do the same thing on .NET
Did anyone have any luck at all pulling this off? I am currently doing this in .NET 1.1 ...
So you *have* done this or you *have not* done this? You seem to be negating your own statement. If you have done this would you like to share with the original poster how you did it?
Quote:
quote:Originally posted by vincentjrg
 ...but may upgrade to 2.0 in the near future

Behavior in 2.0 will most likely be the same as in 1.1.

-Peter
 
Old August 9th, 2007, 07:40 AM
Registered User
 
Join Date: Aug 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry, I wasn't clear. I have NOT done this. If anyone has, let us know.

 
Old August 9th, 2007, 08:23 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

did you try to google this??

there is a class System.Net.NetworkInformation.PhysicalAddress that returns the mac address.. (sorry this is for .net 2, I don't know is this class exists in 1)

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old August 9th, 2007, 08:26 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

anyway google yield a solution for .net 1 ( I don't know if works..)

Code:
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
            ListBox1.Items.Add("MAC address " & mo.Item("MacAddress").ToString())
         End If
      Next
HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old August 10th, 2007, 07:58 AM
Registered User
 
Join Date: Aug 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the help. I have tried that code before and unfortunately it only grabs the MAC address of wherever this code runs (i.e. the web server) and not from remote machines.

So it looks like System.Net.NetworkInformation.PhysicalAddress from 2.0 is my best bet.

Thanks again.

VG

 
Old August 10th, 2007, 08:24 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

mmmm.. the other idea will not work either, it will tell you the address of your current machine...

why do you need the mac of the remote computer??

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old August 10th, 2007, 11:27 AM
Registered User
 
Join Date: Aug 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The client requested that for particular transactions, the following are to be grabbed for security purposes: IP address, machine name, Active Directory username, and MAC address.

The rest were pretty straightforward. The MAC address on the other hand...

 
Old August 10th, 2007, 12:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

mmm.. if you are on a intranet, maybe there is another way to retrieve that info...

but if you are trying to log user activity, maybe better use an activity log...

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get Client's MAC Address! mutinousguy ASP.NET 2.0 Professional 0 September 27th, 2007 07:42 PM
How to get MAC K Address msbsam ASP.NET 2.0 Basics 2 July 10th, 2007 06:36 AM
Getting the MAC Address mswombat Classic ASP Basics 0 June 3rd, 2006 11:45 AM
Tracing MAC addresses in VB .NET CFerthorney Pro VB.NET 2002/2003 1 April 6th, 2005 03:29 AM
how to find mac address of my client...? abdusalam Pro VB.NET 2002/2003 1 August 3rd, 2004 03:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.