如何做一個(gè)文本書寫器?
<%
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) & "隨風(fēng)起舞(www.intels.net)——時(shí)尚咨詢的個(gè)人網(wǎng)站", true
WriteToFile "C:\intels\Test2.txt", chr(13) & chr(10) & "隨風(fēng)起舞(www.intels.net)——時(shí)尚咨詢的個(gè)人網(wǎng)站", false
'Test1.txt contains:
' 中國水利水電出版社(www.waterpub.com.cn)——全國優(yōu)秀出版社
' 隨風(fēng)起舞(www.intels.net)——時(shí)尚咨詢的個(gè)人網(wǎng)站
'Test2.text contains:
' 隨風(fēng)起舞(www.intels.net)——時(shí)尚咨詢的個(gè)人網(wǎng)站
%>
Write to File test is complete
</body></html>
相關(guān)文章
如何最準(zhǔn)確地統(tǒng)計(jì)在線用戶數(shù)?
如何最準(zhǔn)確地統(tǒng)計(jì)在線用戶數(shù)?...2006-11-11如何對一個(gè)文件夾進(jìn)行創(chuàng)建和刪除?
如何對一個(gè)文件夾進(jìn)行創(chuàng)建和刪除?...2006-11-11如何利用當(dāng)前時(shí)間生成隨機(jī)函數(shù)?
如何利用當(dāng)前時(shí)間生成隨機(jī)函數(shù)?...2006-11-11如何實(shí)現(xiàn)文件上傳并自動(dòng)歸類功能?
如何實(shí)現(xiàn)文件上傳并自動(dòng)歸類功能?...2006-11-11