根据我可以找到的网站,下面的代码应该工作.如果我将路径更改为C:\ whats_new.txt它可以正常工作.
Const Filename = "\\SCPAFS1PW\returns\whats_new.txt" ' file to read
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
' Create a filesystem object
Dim FSO
set FSO = server.createObject("Scripting.FileSystemObject")
' Map the logical path to the physical system path
Dim Filepath
Filepath = Filename
if FSO.FileExists(Filepath) Then <--This always returns false
Run Code Online (Sandbox Code Playgroud)
系统报告文件不存在.实际上它实际上是一个权限问题.Microsoft设计了错误,因此如果您没有权限,则无法查找文件夹上的文件名.
我修改了我的permisions到目录,我能够使用UNC路径访问它.