我尝试使用Classic asp修改xml然后保存它。我将文件保存在其他目录时没问题的问题。但是当我试图将它保存到同一个文件时它会给我一个错误
Dim metacachexml
Set metacachexml=Server.CreateObject("Microsoft.XMLDOM")
metacachexml.async=false
metacachexml.load("c:\inetpub\wwwroot\metacache.xml")
If metacachexml.parseError.errorcode<>0 then
response.write("fail")
Else
response.write("succeed <br />")
End if
Set objRoot = metacachexml.documentElement
response.write objRoot.text
Set objMETA = metacachexml.createElement("META")
objRoot.appendChild objMETA
Set objID = metacachexml.createElement("ID")
objMETA.appendChild objID
objID.Text = metaid
Set objNAME= metacachexml.createElement("NAME")
objMETA.appendChild objNAME
objNAME.text= Request.form("metaname")
Set objCONTENT = metacachexml.createElement("CONTENT")
objMETA.appendChild objCONTENT
objCONTENT.text = request.form("content")
metacachexml.Save "c:\inetpub\wwwroot\metacache.xml"
'this one succeed metacachxml.Save "c:\test.xml"
Set objRoot = Nothing
Set objMeta = Nothing
Set objID = Nothing
Set objNAME = Nothing
Set objCONTENT = Nothing
Set metacachexml = nothing
我想覆盖已存档的文件。有人能帮助我吗?
由于
答案 0 :(得分:0)
检查: