Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. MAC address for client M/c

MAC address for client M/c

Scheduled Pinned Locked Moved Visual Basic
questionsysadmin
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nilam11
    wrote on last edited by
    #1

    hi how can i get MAC address of client machine which is unique number not of server ?

    Thanks bye

    D N 2 Replies Last reply
    0
    • N nilam11

      hi how can i get MAC address of client machine which is unique number not of server ?

      Thanks bye

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      How you do that depends on the networking environment the machines are in. If you're talking about any "client" machine on the Internet, you can't. You'll get the MAC address of the last hop that put the packet on your network. If you're talking about a local area network, there are other issues that must be accounted for.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      1 Reply Last reply
      0
      • N nilam11

        hi how can i get MAC address of client machine which is unique number not of server ?

        Thanks bye

        N Offline
        N Offline
        Naji El Kotob
        wrote on last edited by
        #3

        Hi, I am not sure if I fully understand your question, but you can try this snippet. Dim mgmt As Management.ManagementClass = New Management.ManagementClass("Win32_NetworkAdapterConfiguration") Dim mcol As Management.ManagementObjectCollection = mgmt.GetInstances() For Each o As Management.ManagementObject In mcol If o.Item("IPEnabled") = True Then MsgBox(o.Item("MacAddress").ToString()) End If Next for more info please go to http://msdn2.microsoft.com/en-us/library/aa394217.aspx[^] Note: Add a reference to System.Management.dll Hope this helps :)

        NajiCo http://www.InsideVB.NET[^] It's nice 2b important, but it's more important 2b nice...

        D 1 Reply Last reply
        0
        • N Naji El Kotob

          Hi, I am not sure if I fully understand your question, but you can try this snippet. Dim mgmt As Management.ManagementClass = New Management.ManagementClass("Win32_NetworkAdapterConfiguration") Dim mcol As Management.ManagementObjectCollection = mgmt.GetInstances() For Each o As Management.ManagementObject In mcol If o.Item("IPEnabled") = True Then MsgBox(o.Item("MacAddress").ToString()) End If Next for more info please go to http://msdn2.microsoft.com/en-us/library/aa394217.aspx[^] Note: Add a reference to System.Management.dll Hope this helps :)

          NajiCo http://www.InsideVB.NET[^] It's nice 2b important, but it's more important 2b nice...

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          I didn't give him this answer because I don't know if he's looking for the MAC address of machine in his local segment, if he needs the MAC on machines other than Windows, if this has to work on the Internet, ... I firmly believe that if you ask a question in less than 150 words, you've left out important details that are required to give an accurate answer...

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups