还是没有权限访问

lltaotao007 2005-07-05 09:11:57
为了得到访问机器的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 !
我这样做了,还是没有权限

请大大帮助
...全文
89 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
lltaotao007 2005-07-05
  • 打赏
  • 举报
回复
什么fso
freelyl 2005-07-05
  • 打赏
  • 举报
回复
XP文件操作权限确实是怪.......还有,你开了FSO没有?

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧