用ASP生成UTF-8網(wǎng)頁文件的兩種方法
更新時間:2007年07月27日 15:07:52 作者:
方法一:createtextfile生成文件方法
<%function WriteToFile(FileName,FileContent)
set fso=server.createobject("scripting.filesystemobject")
set fp=fso.createtextfile(server.mappath(FileName),,True)
fp.write(FileContent)
end function%>
方法二:ADODB.Stream生成文件方法
<%Function WriteToFile(FileName,FileContent)
Set ccObjStream = Server.CreateObject("ADODB.Stream")
With ccObjStream
.Type = 2
.Mode = 3
.Open
.Charset = "utf-8"
.Position = ccObjStream.Size
.WriteText FileContent
.SaveToFile FileName,2
.Close
End With
End Function%>
復(fù)制代碼 代碼如下:
<%function WriteToFile(FileName,FileContent)
set fso=server.createobject("scripting.filesystemobject")
set fp=fso.createtextfile(server.mappath(FileName),,True)
fp.write(FileContent)
end function%>
方法二:ADODB.Stream生成文件方法
復(fù)制代碼 代碼如下:
<%Function WriteToFile(FileName,FileContent)
Set ccObjStream = Server.CreateObject("ADODB.Stream")
With ccObjStream
.Type = 2
.Mode = 3
.Open
.Charset = "utf-8"
.Position = ccObjStream.Size
.WriteText FileContent
.SaveToFile FileName,2
.Close
End With
End Function%>
相關(guān)文章
ASP,vbs正則輪翻在文章段落后加上網(wǎng)址等內(nèi)容
ASP,vbs正則輪翻在文章段落后加上網(wǎng)址,網(wǎng)站名稱,網(wǎng)站介紹等內(nèi)容2008-06-06asp下取得客戶端IP地址函數(shù) 轉(zhuǎn)換IP地址函數(shù)
asp下取得客戶端IP地址函數(shù) 轉(zhuǎn)換IP地址函數(shù)...2007-08-08ASP.Net?MVC利用NPOI導入導出Excel的示例代碼
這篇文章主要介紹了ASP.Net?MVC利用NPOI導入導出Excel的問題記錄,本文給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2022-05-05把字符串轉(zhuǎn)換成數(shù)據(jù)庫SQL語句格式
把字符串轉(zhuǎn)換成數(shù)據(jù)庫SQL語句格式...2006-10-10用ASP實現(xiàn)對ORACLE數(shù)據(jù)庫的操作
用ASP實現(xiàn)對ORACLE數(shù)據(jù)庫的操作...2007-03-03利用 cache 做對比靜態(tài)頁的網(wǎng)頁技術(shù)
利用 cache 做對比靜態(tài)頁的網(wǎng)頁技術(shù)...2007-10-10