Get Network card MAC address (support Multi Networks)

xBase/clipper
回覆文章
admin
Site Admin
文章: 53
註冊時間: 2014-09-23, 10:58

Get Network card MAC address (support Multi Networks)

文章 admin »

以下範例示範取得網卡 MAC Address 資料:
It's compile use BCC55 and Free!

代碼: 選擇全部

#INCLUDE "FIVEWIN.CH" 
Func    Test() 
Local   aNet      := {},; 
        nI        := 0 

        msgInfo( "Test Begin..." ) 
        aNet := GetMacAddress() 
        msgInfo( "Test OK" ) 
        If Len(aNet) > 0 
           MsgInfo( "You have:["+Str( Len(aNet), 2, 0 )+"] Network Cards!" ) 
           For nI := 1 To Len(aNet) 
               cStr := [] 
               cStr += [Card Num:]+Str(nI,2,0)+CRLF 
               cStr += [Desc:]+aNet[nI,1]+CRLF 
               cStr += [Mac Address:]+aNet[nI,2]+CRLF 
               msgInfo( cStr, "Your Network Cards" ) 
           Next nI 
        Else 
           Tone( 1000, 1 ) 
           MsgStop( "No any Network Card!!" ) 
        EndIf 
Return  NIL 
line ID: ssbbstw
WeChat ID: ssbbstw
回覆文章