Set afile = fso.Createtextfile(FileName,true) afile.writeline filecontent afile.close set afile = nothing
End Function
'读取模板文件内容 Function GetLyrics()
Dim TextStream Dim S Dim File
Set TextStream = FSO.OpenTextFile(FolderPath&tempfilename,1)
S = TextStream.ReadAll & NewLine & NewLine TextStream.Close
GetLyrics = S
End Function
'读取某一页的内容 Function ReadFileContent(filename)
Dim TextStream Dim S Dim File
Set TextStream = FSO.OpenTextFile(FolderPath&filename,1)
S = TextStream.ReadAll & NewLine & NewLine TextStream.Close
ReadFileContent = S
End Function
'检测文件是否存在 '假设已经建立fso Function CheckFileExists(FilePath) if fso.FileExists(FilePath) then CheckFileExists = true else CheckFileExists = false end if End Function
'删除某文件 '假设已经建立fso Function DeleteFile(FilePath) if CheckFileExists(FilePath) then Set f = fso.GetFile(FilePath) f.Delete set f = nothing DeleteFile = true '文件被成功删除 else DeleteFile = false '文件不存在 End if End Function
'删除某一产品所有详细页 Function DeleteOneProMsg(ByVal PageUrl) dim tempar tempar = split(PageUrl,"|")
for i = 1 to ubound(tempar) DeleteFile( ( FolderPath&tempar(i) ) ) '删除所有信息页 next
End Function
'更新一个产品的内容 '其实为覆盖写入 Function UpdateFile(filepath)
Dim f Set f = fso.OpenTextFile(filepath, 2, True) f.Write newcontent f.close set f = nothing End Function