der,xmlfile,content,mode)
writeto=false
If Not IsObjInstalled(theInstalledObjects(9)) Then Exit Function
mode=killint(mode,0,0,2)
xmlfloder=server.mappath(xmlfloder)
Set fso =Server.CreateObject("Scripting.FileSystemObject")
if not fso.folderexists(xmlfloder) Then
fso.createfolder(xmlfloder)
End If
xmlfile=replace(xmlfloder&"\","\\","\")&xmlfile
'' response.write(warn_red(xmlfile))
Dim fsoxml
If fso.fileexists(xmlfile) And mode=1 Then ''存在不写
Exit Function
elseIf fso.fileexists(xmlfile) And mode=2 Then ''重写
Set fsoxml=fso.opentextfile(xmlfile,2)
fsoxml.writeline(content)
fsoxml.close
writeto=true
ElseIf fso.fileexists(xmlfile) And mode=8 Then ''追加
Set fsoxml=fso.opentextfile(xmlfile,8)
fsoxml.writeline(content)
fsoxml.close
writeto=true
ElseIf fso.fileexists(xmlfile) Then
Set fsoxml=fso.opentextfile(xmlfile,2)''重写
fsoxml.writeline(content)
fsoxml.close
writeto=true
Else
Set fsoxml=fso.createtextfile(xmlfile)''创建
fsoxml.writeline(content)
fsoxml.close
writeto=true
End If
End Function
''删除文件
Function delaspfile(x)
On Error Resume Next
delaspfile=False
If Not fileexitornot(x) Then
Exit Function
Else
fso.deletefile server.mappath(x)
delaspfile=True
End if
End Function
''文件存在
Function fileexitornot(file)
On Error Resume Next
Dim f_re_file
f_re_file=true
If not fso.fileexists(server.MapPath(file)) Then f_re_file=False
If err<>0 Then f_re_file=False
fileexitornot=f_re_file
End Function
''错误抑制,打印错误
Function show_err(err)
On Error Resume Next
If err.Number <> 0 Then
Response.Clear
Dim err_mess
err_mess="<b>发生错误:</b><br/>错误 Number: "& err.Number&"<br/>错误信息:"&err.Description&"<br/>出错文件:"&err.Source&"<br/>出错行:"&err.Line&"(不被支持)<br/>"& err
response.write(err_mess)
End if
End Function
''警告:
Function warn_red(mess)
warn_red="<font color=red><b>跟踪:"&mess&"</b></font><br/>"
End Function
''FSO文件目录
Function showallfile(path)
''On Error Resume Next
path=Replace(path,"//","/")
set fso = CreateObject("Scripting.FileSystemObject")
Dim uploadPath,uploadfolder,objSubFolders,allfiles,fileitem,objSubFolder,
sFileName
If InStr(1,path,":\")=0 Then
path=Replace(path,"\","/")
uploadPath = server.mappath(path)
Else
path=Replace(path,"/","\")
uploadPath=path
End If
response.write(warn_red(uploadPath))
if not fso.folderexists(uploadPath) Then
response.write warn_red("路径查找失败")
Exit Function
End If
Set uploadfolder = fso.GetFolder(uploadPath)
If uploadfolder.isrootfolder Then
response.write("<b>根目录</b><br/>")
Else
response.write("<b><font color=""#00008b"">父目录:</font><a href=""default.asp?action=fso&this=top&path="&uploadfolder.parentfolder&""">
"&uploadfolder.parentfolder&" </a></b><br/>")
End If
response.write("<b>目录大小:"&int(uploadfolder.size/1024)&" KB</b><br/>")
set objSubFolders=up