当前位置:编程学习 > asp >>

写入本地txt日志的Stream静态生成函数

可以生成html和txt等文件的静态生成函数代码,适合asp编程朋友爱好,制作静态页面的函数过程,喜欢吧

Function LogResult(sWord)

dim objstream

set objstream = server.createobject("Adodb.Stream")

with objstream

.Type = 2 '设置内容为文本1为2进制

.Mode = 3 '设置为可读可写

.open

.charset = "gb2312"

.position = objstream.size

.writetext = sWord

.savetofile server.MapPath("log_"&GetDateTime()&INT((1000+1)*RND)&".txt"),2

.close

end with

set objstream = nothing

end function

 

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,