页面导航: 首页网络编程编程10000问 → 正文内容

如何做一个文本书写器?

发布:dxy 字体:[增加 减小] 类型:转载

<%
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)——全国优秀出版社", True
WriteToFile "C:\intels\Test2.txt", "
中国水利水电出版社(www.waterpub.com.cn)——全国优秀出版社", false
WriteToFile "C:\intels\Test1.txt", chr(13) & chr(10) & "
随风起舞(www.intels.net)——时尚咨询的个人网站", true
WriteToFile "C:\intels\Test2.txt", chr(13) & chr(10) & "
随风起舞(www.intels.net)——时尚咨询的个人网站", false

'Test1.txt contains:
'
中国水利水电出版社(www.waterpub.com.cn)——全国优秀出版社
'
随风起舞(www.intels.net)——时尚咨询的个人网站
'Test2.text contains:
'
随风起舞(www.intels.net)——时尚咨询的个人网站
%>
Write to File test is complete
</body></html>

浏览次数:载入中... 打印本文关闭本文文章来源
·在百度中搜索关于“如何做一个文本书写器?相关内容

文章评论

共有 位脚本之家网友发表了评论我来说两句

同 类 文 章
最 近 更 新
热 点 排 行