选择显示字体大小

获得客户端的mac(media access control)地址


get the clients mac(media access control) address, a hardware address that uniquely identifies each
node of a.network. works great on lan's. firewalls and proxy's will be an issue depending what side of
them you're coding for.


can't copy and paste this?
click here for a copy-and-paste friendly version of this code!

 

'**************************************
' for :mac address
'**************************************
this code is as is! i had a need for it on a
project i was working on and found almost no info
anywhere on what i needed to accomplish. if it
helps you, great! if it does not work for you:
1.make sure you're not trying to hit on the same
pc it's on.
2.comment out where the file gets deleted
(fso.deletefile "c:\" & strip & ".txt"), to view
some potential error info.
3.have fun debugging :) (i did)

code:
can't copy and paste this?
click here for a copy-and-paste friendly version of this code!

 

'**************************************
' name: mac address
' description:get the clients mac(media
' access control)
address, a hardware address that uniquely
identifies each node of a.network. works great on
lan's. firewalls and proxy's will be an issue
depending what side of them you're coding for.
' by: jerry aguilar
'
'
' inputs:none
'
' returns:returns the client ip and mac
' address.
'
'assumes:you can't navigate to it runnin
' g pws on the same
pc but if you are running pws, you can navigate
to it from another pc on the same lan (it does
not like 127.0.0.1)
'
'side effects:none
'
'warranty:
'code provided by pl.net source code(tm)
' (www.pl.net-source-code.com) 'as is', wi
' thout warranties as to performance, fitn
' ess, merchantability,and any other warra
' nty (whether expressed or implied).
'terms of agreement:
'by using this source code, you agree to
' the following terms...
' 1) you may use this source code in per
' sonal projects and may compile it into a
' n .exe/.dll/.ocx and distribute it in bi
' nary format freely and with no charge.
' 2) you may not redistribute this sourc
' e code (for example to a web site) witho
' ut written permission from the original
' author.failure to do so is a violation o
' f copyright laws.
' 3) you may link to this code from anot
' her website, provided it is not wrapped
' in a frame.
' 4) the author of this code may have re
' tained certain additional copyright righ
' ts.if so, this is indicated in the autho
' r's description.
'**************************************

<&#37;@ language=&quot;vbscript&quot;&#37;>
<&#37;
strip = request.servervariables(&quot;remote_addr&quot;)
strmac = getmacaddress(strip)
strhost = request.servervariables(&quot;remote_host&quot;)
function getmacaddress(strip)
set.net = server.createobject(&quot;wscript.network&quot;)
set sh = server.createobject(&quot;wscript.shell&quot;)
sh.run &quot;&#37;comspec&#37; /c nbtstat -a &quot; & strip & &quot; > c:\&quot; & strip & &quot;.txt&quot;,0,true
set sh = nothing
set fso = createobject(&quot;scripting.filesystemobject&quot;)
set ts = fso.opentextfile(&quot;c:\&quot; & strip & &quot;.txt&quot;)
macaddress = null
do while not ts.atendofstream
data = ucase(trim(ts.readline))
if instr(data,&quot;mac address&quot;) then
macaddress = trim(split(data,&quot;=&quot;)(1))
exit do
end if
loop
ts.close
set ts = nothing
fso.deletefile &quot;c:\&quot; & strip & &quot;.txt&quot;
set fso = nothing
getmacaddress = macaddress
end function
&#37;>
<html>
<head>
<title>say hello to the mac man</title>
</head>
<body>
<&#37;response.write(&quot;your ip is : &quot; & strip & &quot;<br>&quot; & vbcrlf)&#37;>
<&#37;response.write(&quot;your mac is : &quot; & strmac & vbcrlf)&#37;>
</body>
</html>


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons