%
function WriteToFile(FileName, Contents, Append)
on error resume next
if Append = true then
iMode = 8
else
iMode = 2
end if
set oFs = server.createobject("Scripting.FileSystemObject")
set oTextFile = oFs.OpenTextFile(FileName, iMode, True)
oTextFile.Write Contents
oTextFile.Close
set oTextFile = nothing
set oFS = nothing
end function
%>
html>
body>
%
WriteToFile "C:\intels\Test1.txt", "中國水利水電出版社(www.waterpub.com.cn)——全國優(yōu)秀出版社", True
WriteToFile "C:\intels\Test2.txt", "中國水利水電出版社(www.waterpub.com.cn)——全國優(yōu)秀出版社", false
WriteToFile "C:\intels\Test1.txt", chr(13) chr(10) "隨風起舞(www.intels.net)——時尚咨詢的個人網(wǎng)站", true
WriteToFile "C:\intels\Test2.txt", chr(13) chr(10) "隨風起舞(www.intels.net)——時尚咨詢的個人網(wǎng)站", false
'Test1.txt contains:
' 中國水利水電出版社(www.waterpub.com.cn)——全國優(yōu)秀出版社
' 隨風起舞(www.intels.net)——時尚咨詢的個人網(wǎng)站
'Test2.text contains:
' 隨風起舞(www.intels.net)——時尚咨詢的個人網(wǎng)站
%>
Write to File test is complete
/body>/html>