还是没有权限访问
为了得到访问机器的MAC地址我使用如下代码
Function GetMACAddress(strIP)
Set net = Server.CreateObject("wscript.network")
Set sh = Server.CreateObject("wscript.shell")
10行sh.run "%comspec% /c nbtstat -A " & strIP & "> c:\" & strIP & ".txt ",0,true
Set sh = nothing
Set fso = createobject("scripting.filesystemobject")
Set ts = fso.opentextfile("c:\" & 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
ts.close
Set ts = nothing
fso.deletefile "c:\" & strIP & ".txt"
Set fso = nothing
GetMACAddress = macaddress
End Function
把程序放在但在winxp sp2+IIS的机器上,登录访问时,提示
Microsoft VBScript 运行时错误 (0x800A0046)
没有权限
getmac.asp, 第 10 行
有网友说在根目录文件夹下,单击右键打开属性面板,在安全里设置use或everyone用户的权限全部选中!然后have a try !
我这样做了,还是没有权限
请大大帮助