newasp中main类(67)
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
'作 用:截取相匹配的内容
'参 数:Str ----原字符串
' PatStr ----符合条件字符
'================================================
内容版权声明:除非注明,否则皆为本站原创文章。