[分享]用ASP读写UTF-8编码的文件[2007-10-16]
[code]'-------------------------------------------------'函数名称:ReadTextFile
'作用:利用AdoDb.Stream对象来读取UTF-8格式的文本文件
'----------------------------------------------------
function ReadFromTextFile (FileUrl,CharSet)
dim str
set stm=server.CreateObject("adodb.stream")
stm.Type=2 '以本模式读取
stm.mode=3
stm.charset=CharSet
stm.open
stm.loadfromfile server.MapPath(FileUrl)
str=stm.readtext
stm.Close
set stm=nothing
ReadFromTextFile=str
end function
'-------------------------------------------------
'函数名称:WriteToTextFile
'作用:利用AdoDb.Stream对象来写入UTF-8格式的文本文件
'----------------------------------------------------
Sub WriteToTextFile (FileUrl,byval Str,CharSet)
set stm=server.CreateObject("adodb.stream")
stm.Type=2 '以本模式读取
stm.mode=3
stm.charset=CharSet
stm.open
stm.WriteText str
stm.SaveToFile server.MapPath(FileUrl),2
stm.flush
stm.Close
set stm=nothing
end Sub
[/code]
最新最准确的企业名录和全球通VIP数据
环球名录网您需要的名录都可以在这里找到提供每月更新的注册企业名录,老板手机号码,各地的车主名录, 最新电视购物数据,内部通讯录
全国各地全球通数据,联通数据,最新股民资料,银行大客户资料,移动vip, 业主名录资料,企业黄页,航空数据,公司名单, 阿里公司库数据,传真号码等名录号码资源。
产品质量非常高,可以把目标客户定位得非常精准,是精准营销的利器;可以助你轻松业绩飙升!
参考网站:[url=http://www.hq818.cn]http://www.hq818.cn[/url] qq:178533126
呵呵
好你发的好
呵呵
我来顶
希望你会有更的作品
更多的贴
我会一直支持你
也希望从你的作品中学习一些
呵呵
唯一可以用来糊口的网站www.shyjpq.cn
[url=http://www.shyjpq.cn]音乐喷泉[/url]
[url=http://www.shyjpq.cn]喷泉公司[/url]
[url=http://www.shyjpq.cn/jinggsclp.asp]景观水处理[/url]
[url=http://www.shyjpq.cn]上海喷泉公司[/url]
页:
[1]