ASP获取远程的计算机名
来源:互联网 发布:云计算主题基金 编辑:程序博客网 时间:2024/05/01 04:20
strIP = Request.ServerVariables("REMOTE_ADDR")
strHost = Request.ServerVariables("REMOTE_HOST")
Set net = Server.CreateObject("wscript.network")
Set sh = Server.CreateObject("wscript.shell")
sh.run "%comspec% /c nbtstat -A " & strIP & " 〉 d:/wwwtemp/" & strIP & ".txt",0,true
sh.run "%comspec% /c ping -a " & strIP & " 〉 d:/wwwtemp/" & strIP & "ping.txt",0,true
Set sh = nothing
'分析ping命令结果获取计算机名
Function GetComputerName(strIP)
set fso=CreateObject("scripting.filesystemobject")
set ts=fso.opentextfile("d:/wwwtemp/" & strIP & "ping.txt")
computername=null
do while not ts.AtEndOfStream
data = ucase(trim(ts.readline))
if instr(data,"[") then
computername=trim(split(data,"[")(0))
computername=trim(replace(computername,"PINGING",""))
exit do
end if
loop
GetComputerName=computername
End Function
'分析nbtstat命令结果获取MAC地址
Function GetMACAddress(strIP)
Set fso = createobject("scripting.filesystemobject")
Set ts = fso.opentextfile("d:/wwwtemp/" & strIP & ".txt")
macaddress = null
Do While Not ts.AtEndOfStream
data = ucase(trim(ts.readline))
If instr(data,"MAC ADDRESS") Then
macaddress = trim(split(data,"=")(1))
Exit Do
End If
loop
GetMACAddress = macaddress
End Function
<script type="text/javascript"><!--google_ad_client = "pub-4717125974896180";/* 728x90, 创建于 09-7-17 */google_ad_slot = "3536088218";google_ad_width = 728;google_ad_height = 90;// --></script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>
- ASP获取远程的计算机名
- 如何使用ASP获取远程的计算机名
- C# 远程链接指定计算机,获取该计算机的计算机名等信息
- asp.net 获取客户端计算机名
- 获取指定IP地址远程主机的计算机名和Mac地址
- asp.net获取本机计算机名和IP
- asp.net利用activeX获取客户端IP MAC 计算机名
- 获取局域网的计算机名和IP
- 获取计算机名函数
- 获取IP/计算机名
- 根据计算机名获取该计算机的所有IP
- 获取远程计算机的网卡地址
- 如何获取远程计算机的时间
- 如何获取远程计算机的用户列表?
- 通过ip获取计算机名
- 获取计算机名及用户名
- ping计算机名获取IP
- 获取本机计算机名及登录的用户名
- 面对
- 编程能力的四种心理境界 你属于那一种?(转)
- July, 23(R)
- [转帖自沪江]灵指神探
- FFmpeg开发指南-第0篇
- ASP获取远程的计算机名
- 很长时间没发东西了,最近真的很累
- 使用Jacob将Word转为Html或txt
- 对象多继承中的数据结构分析
- [linux]-解决Evince中文乱码问题
- save函数 与 load函数
- Google的蜘蛛模拟器
- Ubuntu 9.10 Alpha 3 “KarmicKoala”
- MP3开源项目第一次讨论结果