Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a MAC address class?
Message
From
22/12/2004 12:52:12
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00971494
Message ID:
00971503
Views:
14
>Is there a MAC address class in the .NET framework?
>I come out empty handed when I try to search the M$ docs for a MAC address class.
>If there is no such class in the .NET framework I guess I have to build my own class.
>
>Einar

Einar,
Your old thread didn't help? Thread #963864
Using winAPI I get it with his code in VFP (there was a function mapping on MSDN somewhere):
Local pGUID,rGUID,lcOldError, lnResult
Declare integer CoCreateGuid in 'OLE32.dll' string @pguid
Declare integer StringFromGUID2 in 'OLE32.dll' ;
  string rguid, string @lpsz, integer cchMax
Declare integer UuidCreateSequential in 'RPCRT4.dll'  string @ Uuid

pGUID=replicate(chr(0),16)
rGUID=replicate(chr(0),80)

lcOldError = On('error')
On Error lnResult = CoCreateGuid(@pGUID)
lnResult = UuidCreateSequential(@pGUID) 
On Error &lcOldError

return substr( iif( lnResult = 0 and ;
	StringFromGUID2(pGUID,@rGUID,40) # 0, ;
    StrConv(left(rGUID,76),6), "" ), 26,12)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform