{"id":657,"date":"2008-05-19T09:23:08","date_gmt":"2008-05-19T09:23:08","guid":{"rendered":"http:\/\/6teen.ru\/?p=606"},"modified":"2008-05-19T09:23:08","modified_gmt":"2008-05-19T09:23:08","slug":"5398","status":"publish","type":"post","link":"http:\/\/pblog.ru\/lab\/?p=657","title":{"rendered":"\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 MAC \u0430\u0434\u0440\u0435\u0441\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430"},"content":{"rendered":"<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 MAC \u0430\u0434\u0440\u0435\u0441\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430<br \/>\n<!--more--><\/p>\n<pre class=\"alt2\" style=\"margin:0px; padding:6px; border:1px inset; width:580px; height:320px; overflow:auto\"><div>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 MAC \u0430\u0434\u0440\u0435\u0441\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430\n\n\u0410\u0432\u0442\u043e\u0440: Daniel Wischnewski\n\n\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u044e\u043d\u0438\u0442 NB30. \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 GetMACAddress \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0430\u0434\u0440\u0435\u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430.\n\n\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c: Delphi 3.x (\u0438\u043b\u0438 \u0432\u044b\u0448\u0435)\n\n\u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0431\u044b\u043b \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 Borland:\nhttp:\/\/community.borland.com\/article\/0,1410,26040,00.html\n\nuses\nNB30;\n\nfunction GetAdapterInfo(Lana: Char): String;\nvar\nAdapter: TAdapterStatus;\nNCB: TNCB;\nbegin\nFillChar(NCB, SizeOf(NCB), 0);\nNCB.ncb_command := Char(NCBRESET);\nNCB.ncb_lana_num := Lana;\nif Netbios(@NCB) <> Char(NRC_GOODRET) then\nbegin\nResult := 'mac not found';\nExit;\nend;\n\nFillChar(NCB, SizeOf(NCB), 0);\nNCB.ncb_command := Char(NCBASTAT);\nNCB.ncb_lana_num := Lana;\nNCB.ncb_callname := '*';\n\nFillChar(Adapter, SizeOf(Adapter), 0);\nNCB.ncb_buffer := @Adapter;\nNCB.ncb_length := SizeOf(Adapter);\nif Netbios(@NCB) <> Char(NRC_GOODRET) then\nbegin\nResult := 'mac not found';\nExit;\nend;\nResult :=\nIntToHex(Byte(Adapter.adapter_address[0]), 2) + '-' +\nIntToHex(Byte(Adapter.adapter_address[1]), 2) + '-' +\nIntToHex(Byte(Adapter.adapter_address[2]), 2) + '-' +\nIntToHex(Byte(Adapter.adapter_address[3]), 2) + '-' +\nIntToHex(Byte(Adapter.adapter_address[4]), 2) + '-' +\nIntToHex(Byte(Adapter.adapter_address[5]), 2);\nend;\n\nfunction GetMACAddress: string;\nvar\nAdapterList: TLanaEnum;\nNCB: TNCB;\nbegin\nFillChar(NCB, SizeOf(NCB), 0);\nNCB.ncb_command := Char(NCBENUM);\nNCB.ncb_buffer := @AdapterList;\nNCB.ncb_length := SizeOf(AdapterList);\nNetbios(@NCB);\nif Byte(AdapterList.length) > 0 then\nResult := GetAdapterInfo(AdapterList.lana[0])\nelse\nResult := 'mac not found';\nend;\n<\/div><\/pre>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 MAC \u0430\u0434\u0440\u0435\u0441\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[448,457],"tags":[1088,182,814,1574],"_links":{"self":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/657"}],"collection":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=657"}],"version-history":[{"count":0,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/657\/revisions"}],"wp:attachment":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=657"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=657"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=657"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}