Re: [問題] 如何透過windows API抓MAC address

看板Programming作者 (你這可惡的騙子)時間18年前 (2007/11/07 11:42), 編輯推噓3(303)
留言6則, 3人參與, 最新討論串2/2 (看更多)
話說...怎麼有人喜歡回應一些沒什麼意義的話.. http://support.microsoft.com/kb/118623 這裡有source code 貼成程式碼的時候...printf的那一行...因為他有換行..要記得自己在最後面加上 \ printf( "The Ethernet Number on LANA %d is:\ %02x%02x%02x%02x%02x%02x\n",\ lenum.lana[i],\ Adapter.adapt.adapter_address[0],\ Adapter.adapt.adapter_address[1],\ Adapter.adapt.adapter_address[2],\ Adapter.adapt.adapter_address[3],\ Adapter.adapt.adapter_address[4],\ Adapter.adapt.adapter_address[5] ); C:\>cl -I "C:\Program Files\Microsoft SDKs\Windows\v5.0\Include" -L "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib\netapi32.lib" mac.c 就這樣.. -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.123.102.254

11/07 11:45, , 1F
對了...路徑你要自己改一下..看你裝05or08
11/07 11:45, 1F

11/07 16:11, , 2F
printf 第一行和第二行字串都 "" 括住
11/07 16:11, 2F

11/07 16:12, , 3F
其他的 \ 都不是必要
11/07 16:12, 3F

11/08 11:49, , 4F
謝謝你,我會試試看
11/08 11:49, 4F

11/08 13:12, , 5F
我試成功了..我想是因為我沒把netapi32.lib
11/08 13:12, 5F

11/08 13:12, , 6F
加進去的關係,謝謝你的回答。
11/08 13:12, 6F
文章代碼(AID): #17CJGdvZ (Programming)
文章代碼(AID): #17CJGdvZ (Programming)