首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

asp-CreateObject("adodb.stream")资料写入utf-8格式

2012-12-24 
asp---CreateObject(adodb.stream)文件写入utf-8格式用CreateObject(Scripting.FileSystemObject)写入

asp---CreateObject("adodb.stream")文件写入utf-8格式

用CreateObject("Scripting.FileSystemObject")写入utf-8的文件会出现乱码问题

可以使用CreateObject("adodb.stream")写入,设置编码为utf-8即可

function writeToFile(charset,content,filepath)set stm=server.CreateObject("adodb.stream")stm.Type=2'以本模式读取stm.mode=3stm.charset=charsetstm.openstm.WriteText contentstm.SaveToFile server.MapPath(filepath),2 stm.flushstm.Closeset stm=nothingend function

charset:编码

content:写入内容

filepath:文件路径

热点排行