finding_20the_20mac_20address
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
finding_20the_20mac_20address [2018/03/31 13:19] – external edit 127.0.0.1 | finding_20the_20mac_20address [2024/01/05 00:22] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 4: | Line 4: | ||
===== Method 1 ===== | ===== Method 1 ===== | ||
\\ This method is the simplest, and works on all versions of Windows from Windows 95 to Windows Vista or later. However if two or more network adaptors are fitted it returns only the MAC address of the primary adaptor. Also, it relies on a feature of Windows which isn't guaranteed to be reliable, so should be used at your own risk!\\ \\ | \\ This method is the simplest, and works on all versions of Windows from Windows 95 to Windows Vista or later. However if two or more network adaptors are fitted it returns only the MAC address of the primary adaptor. Also, it relies on a feature of Windows which isn't guaranteed to be reliable, so should be used at your own risk!\\ \\ | ||
+ | <code bb4w> | ||
SYS " | SYS " | ||
SYS " | SYS " | ||
Line 21: | Line 22: | ||
PRINT "MAC address = " MACaddress$ | PRINT "MAC address = " MACaddress$ | ||
+ | </ | ||
\\ | \\ | ||
===== Method 2 ===== | ===== Method 2 ===== | ||
\\ This method is almost as simple as the preceding one, but works **only under Windows 2000 Professional, | \\ This method is almost as simple as the preceding one, but works **only under Windows 2000 Professional, | ||
+ | <code bb4w> | ||
INSTALL @lib$+" | INSTALL @lib$+" | ||
PROC_initsockets | PROC_initsockets | ||
Line 46: | Line 49: | ||
PRINT "MAC address = " MACaddress$ | PRINT "MAC address = " MACaddress$ | ||
+ | </ | ||
\\ | \\ | ||
===== Method 3 ===== | ===== Method 3 ===== | ||
\\ This method works on versions of Windows from Windows 95 to Windows XP, but //only if NetBIOS is installed// | \\ This method works on versions of Windows from Windows 95 to Windows XP, but //only if NetBIOS is installed// | ||
+ | <code bb4w> | ||
NCBNAMSZ = 16 | NCBNAMSZ = 16 | ||
NCBRESET = &32 | NCBRESET = &32 | ||
Line 80: | Line 85: | ||
PRINT "MAC address = " MACaddress$ | PRINT "MAC address = " MACaddress$ | ||
+ | </ | ||
\\ | \\ | ||
===== Method 4 ===== | ===== Method 4 ===== | ||
\\ This method can return the MAC address of multiple network adaptors, so is useful if you need information other than just for the primary adaptor. It works on versions of Windows from 98 to Vista or later (with acknowledgements to Jon Ripley on whose code this is based):\\ \\ | \\ This method can return the MAC address of multiple network adaptors, so is useful if you need information other than just for the primary adaptor. It works on versions of Windows from 98 to Vista or later (with acknowledgements to Jon Ripley on whose code this is based):\\ \\ | ||
+ | <code bb4w> | ||
SYS " | SYS " | ||
SYS " | SYS " | ||
Line 115: | Line 122: | ||
PRINT "MAC address = " MACaddress$ | PRINT "MAC address = " MACaddress$ | ||
NEXT i% | NEXT i% | ||
+ | </ | ||
\\ | \\ | ||
===== Method 5 ===== | ===== Method 5 ===== | ||
\\ This method uses SNMP (the **Simple Network Management Protocol**). It too can return the MAC address of more than one adaptor, and runs on Windows 2000, Windows XP and Windows Vista or later. It uses the most complex code of any of the methods:\\ \\ | \\ This method uses SNMP (the **Simple Network Management Protocol**). It too can return the MAC address of more than one adaptor, and runs on Windows 2000, Windows XP and Windows Vista or later. It uses the most complex code of any of the methods:\\ \\ | ||
+ | <code bb4w> | ||
SYS " | SYS " | ||
SYS " | SYS " | ||
Line 204: | Line 213: | ||
SYS " | SYS " | ||
SYS " | SYS " | ||
+ | </ |
finding_20the_20mac_20address.1522502361.txt.gz · Last modified: 2024/01/05 00:17 (external edit)