1

我在用 ASP 加载 XML 文件时遇到了一些麻烦。这是 XML 文件的位置(它是一个 UNC 网址):

\\ilife104\teamdisk\Shared\Integration\System\dev\Data\prcImportFactSetFeeds\fileList.xml

这是我的代码:

<% 
'load the XML file.. 
Option Explicit
Response.Buffer = True

Dim xml
Set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = False
xml.load (Server.MapPath("\\ilife104\teamdisk\Shared\Integration\System\dev\Data\prcImportFactSetFeeds\fileList.xml"))

Dim name, retrieved 
name = xml.documentElement.childNodes(0).text
retrieved = xml.documentElement.childNodes(2).text

Set xml = Nothing
%>  

它给出了错误:

Server.MapPath() error 'ASP 0174 : 80004005'

Invalid Path Character(s)

/ITWeb/Interfaces/je/index.asp, line 9

An invalid '/' or '\' was found in the Path parameter for the MapPath method. 

有人知道解决办法吗??提前感谢,詹姆斯。

4

2 回答 2

4

Server.MapPath采用页面相对路径(例如,../Images/Something.png)并返回磁盘上的完整路径。

由于您已经有了文件路径,因此您根本不应该调用Server.MapPath

于 2011-03-02T15:59:32.703 回答
0

需要是

\\\\servername\\folder\\folder\\whateverfileyouwant.ext

你必须逃避角色

于 2012-12-07T15:15:10.013 回答