【发布时间】:2014-07-27 08:20:18
【问题描述】:
我试图通过 Classic ASP FSO 组件获取文件列表。
但即使我从远程桌面授予根文件权限(IUSR_domain),我仍然收到此错误。
Microsoft VBScript runtime error '800a0046'
Permission denied
/default2.asp, line 28
<%
fs,fo,x
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("C:\inetpub\vhosts\xx.com\httpdocs\photo\other") <-- line 28
for each x in fo.files
%>
<div id="photos">
<div class="photo"><%Response.write(x.Name & "<br>")%></div>
</div>
<%next
set fo=nothing
set fs=nothing
%>
【问题讨论】:
-
如果路径确实正确,您将需要确保访问网站的用户上下文至少具有对
C:\inetpub\vhosts\xx.com\httpdocs\photo\other的读取权限。如果您使用匿名访问,设置为IUSR或IUSR_machinename的帐户是什么(默认值因 IIS 版本而异)?
标签: asp-classic fso