Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get Mac Address & Specs
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00652249
Message ID:
00652375
Views:
14
>Hi, I've got a couple questions...
>
>Quetsion #1: Does anyone know the basic specs for a "mac address", such as maximum length, is there any positions where it always contains letters and/or numbers, does case make any difference, and the like?
>
>Question #2: Is there any way to get the net card's manufacturer name, model and/or serial number so a positive identification can be made, even if the card is dead?
>
>Quetsion #3: How can I get a long string of numbers converted to a number without the scientific notation stuff? Also the VAL() function is only good thru 16 characters, and what I'm trying to do is converting the mac address to all numbers by using the ASC() function on each of the characters and concatnating them together to make one long number as in "1245854526951254124477581254698214587452145874521". (If the mac address has 12 characters and each character converts to a 3 digit character, then thats 36 characters.) Next I need to do some math on it so I can create a key string, and thats where the problem comes in. I would like to continue concatnating the ASC() of the DISKSPACE("C:",1)+DISKSPACE("D:",1) command to the mac address, to really make a unique string that matches only 1 computer in the world. And if the netcard and/or harddrive C: or D: partitions configurations change, a new key would be needed.
>
>Thanks,

Stanley,
#1. and #2. If you are using WinNT with WMI installed, Win2K or XP, you can use the Windows Managmement Instrumentation.
omgr = GetObject("winmgmts:")


oadaptcol = omgr.InstancesOf("Win32_NetworkAdapter")
for each oadapter in oadaptcol
	if type("oadapter.Properties_('AdapterType').Value") = "C" ;
		and upper(oadapter.Properties_('AdapterType').Value) = "ETHERNET 802.3" then
		? 	oadapter.Properties_('Name').Value,oadapter.Properties_('ServiceName').Value, ;
			oadapter.Properties_('Manufacturer').Value,oadapter.Properties_('MACAddress').Value
	endif
	oadapter = .NULL.
endfor
oadaptcol = .NULL.
omgr = .NULL.
This will list only the local ethernet adapters. It will not list any WAN adapters or any other network technology you may have (e.g. Token Ring, Wireless, Fiber, etc.). You can change the filter to something else or remove it entirely to retrieve all adapters.

#3. You can use the transform() function to convert the numeric to a string with all the digits. The scientific notation is only used for display purposes.
transform(diskspace('c:',1),'999999999999999')
HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform