ByVal SoureFile, ByVal NewFile)
On Error Resume Next
If SoureFile = "" Then Exit Function
If NewFile = "" Then Exit Function
If InStr(SoureFile, ":") = 0 Then SoureFile = Server.MapPath(SoureFile)
If InStr(NewFile, ":") = 0 Then NewFile = Server.MapPath(NewFile)
Dim fso
Set fso = Server.CreateObject(FSO_ScriptName)
If fso.FileExists(SoureFile) Then
fso.CopyFile SoureFile, NewFile
End If
Set fso = Nothing
If Err.Number <> 0 Then Err.Clear
End Function
''================================================
''函数名:CopyToFolder
''作 用:复制文件夹
''参 数:SoureFolder ----原路径
'' NewFolder ----目标路径
''================================================
Public Function CopyToFolder(ByVal SoureFolder, ByVal NewFolder)
On Error Resume Next
If SoureFolder = "" Then Exit Function
If NewFolder = "" Then Exit Function
If InStr(SoureFolder, ":") = 0 Then SoureFolder = Server.MapPath(SoureFolder)
If InStr(NewFolder, ":") = 0 Then NewFolder = Server.MapPath(NewFolder)
Dim fso
Set fso = Server.CreateObject(FSO_ScriptName)
If fso.FolderExists(SoureFolder) Then
fso.CopyFolder SoureFolder, NewFolder
End If
Set fso = Nothing
If Err.Number <> 0 Then Err.Clear
End Function
''=============================================================
''过程名:CreatedTextFile
''作 用:创建文本文件
''参 数:filename ----文件名
'' body ----主要内容
''=============================================================
Public Function CreatedTextFile(ByVal FileName, ByVal body)
On Error Resume Next
If InStr(FileName, ":") = 0 Then FileName = Server.MapPath(FileName)
Dim fso,f
Set fso = Server.CreateObject(FSO_ScriptName)
Set f = fso.CreateTextFile(FileName)
f.WriteLine body
f.Close
Set f = Nothing
Set fso = Nothing
If Err.Number <> 0 Then Err.Clear
End Function
''================================================
''函数名:Readfile
''作 用:读取文件内容
''参 数:fromPath ----来源文件路径
''================================================
Public Function Readfile(ByVal fromPath)
On Error Resume Next
Dim strTemp,fso,f
If InStr(fromPath, ":") = 0 Then fromPath = Server.MapPath(fromPath)
Set fso = Server.CreateObject(FSO_ScriptName)
If fso.FileExists(fromPath) Then
Set f = fso.OpenTextFile(fromPath, 1, True)
strTemp = f.ReadAll
f.Close
Set f = Nothing
End If
Set fso = Nothing
Readfile = strTemp
If Err.Number <> 0 Then Err.Clear
End Function
''================================================
''函数名:CutMatchContent
''作 用:截取相匹配的内容
'