{"id":674,"date":"2011-01-28T09:59:57","date_gmt":"2011-01-28T01:59:57","guid":{"rendered":""},"modified":"2014-03-11T22:36:21","modified_gmt":"2014-03-11T14:36:21","slug":"%e9%80%9a%e8%bf%87asp%e8%8e%b7%e5%8f%96mac%e5%9c%b0%e5%9d%80%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/www.xiaoyebailong.com\/index.php\/2011\/01\/28\/674.htm","title":{"rendered":"\u901a\u8fc7ASP\u83b7\u53d6MAC\u5730\u5740\u7684\u65b9\u6cd5"},"content":{"rendered":"<p>&lt;%@ LANGUAGE=&quot;VBSCRIPT&quot;%&gt;<br \/>\n&lt;%<br \/>\nstrIP = Request.ServerVariables(&quot;REMOTE_ADDR&quot;)<br \/>\nstrMac = GetMACAddress(strIP)<br \/>\nstrHost = Request.ServerVariables(&quot;REMOTE_HOST&quot;)<br \/>\nFunction GetMACAddress(strIP)<br \/>\nSet net = Server.CreateObject(&quot;wscript.network&quot;)<br \/>\nSet sh = Server.CreateObject(&quot;wscript.shell&quot;)<br \/>\nsh.run &quot;%comspec% \/c nbtstat -A &quot; &amp; strIP &amp; &quot; &gt; c:\\&quot; &amp; strIP &amp; &quot;.txt&quot;,0,true<br \/>\nSet sh = nothing<br \/>\nSet fso = createobject(&quot;scripting.filesystemobject&quot;)<br \/>\nSet ts = fso.opentextfile(&quot;c:\\&quot; &amp; strIP &amp; &quot;.txt&quot;)<br \/>\nmacaddress = null<br \/>\nDo While Not ts.AtEndOfStream<br \/>\ndata = ucase(trim(ts.readline))<br \/>\nIf instr(data,&quot;MAC ADDRESS&quot;) Then<br \/>\nmacaddress = trim(split(data,&quot;=&quot;)(1))<br \/>\nExit Do<br \/>\nEnd If<br \/>\nloop<br \/>\nts.close<br \/>\nSet ts = nothing<br \/>\nSet fso = nothing<br \/>\nGetMACAddress = macaddress<br \/>\nEnd Function <br \/>\n%&gt;<br \/>\n&lt;HTML&gt;<br \/>\n&lt;HEAD&gt;<br \/>\n&lt;TITLE&gt;\u901a\u8fc7ASP\u83b7\u53d6MAC\u5730\u5740\u7684\u65b9\u6cd5&lt;\/TITLE&gt;<br \/>\n&lt;\/HEAD&gt;<br \/>\n&lt;BODY&gt;<br \/>\n&lt;%Response.Write(&quot;\u60a8\u673a\u5668\u7684IP\u662f: &quot; &amp; strIP &amp; &quot;&lt;BR&gt;&quot; &amp; vbcrlf)%&gt;<br \/>\n&lt;%Response.Write(&quot;\u60a8\u673a\u5668\u7684MAC\u5730\u5740\u662f: &quot; &amp; strMac &amp; vbcrlf)%&gt;<br \/>\n&lt;\/BODY&gt;<br \/>\n&lt;\/HTML&gt; <br \/>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;%@ LANGUAGE=&quot;VBSCRIPT&quot;%&gt; &lt;% strIP = Request.ServerVariables(&quot;REMOTE_ADDR&quot;) strMac = GetMAC&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-674","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/674","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/comments?post=674"}],"version-history":[{"count":1,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/674\/revisions"}],"predecessor-version":[{"id":66530,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/674\/revisions\/66530"}],"wp:attachment":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/media?parent=674"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/categories?post=674"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/tags?post=674"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/topic?post=674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}