作者jlovet (你這可惡的騙子)
看板Programming
標題Re: [問題] 如何透過windows API抓MAC address
時間Wed Nov 7 11:42:28 2007
話說...怎麼有人喜歡回應一些沒什麼意義的話..
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
→ jlovet:對了...路徑你要自己改一下..看你裝05or08140.123.102.254 11/07 11:45
推 UNARYvvv:printf 第一行和第二行字串都 "" 括住 140.115.53.123 11/07 16:11
→ UNARYvvv:其他的 \ 都不是必要 140.115.53.123 11/07 16:12
推 cjoe:謝謝你,我會試試看140.130.212.245 11/08 11:49
推 cjoe:我試成功了..我想是因為我沒把netapi32.lib140.130.212.245 11/08 13:12
→ cjoe:加進去的關係,謝謝你的回答。140.130.212.245 11/08 13:12