iType = 2    '类型(1-二进">

asp生成utf-8静态html页面的函数代码

80酷酷网    80kuku.com

  

用asp生成静态utf-8编码网页的代码。用fso无法生成,只有使用Adodb.Stream才可以生成真正的UTF-8静态页

<%
Dim sContent,iType,oAdos
sContent = ""
iType = 2    '类型(1-二进制/2-文本)
Set oAdos = Server.CreateObject("Adodb.Stream")
With oAdos
    .Type = iType
    .Mode = 3
    .CharSet = "utf-8"
    .Open
    If iType = 1 Then
        .Write sContent
    Else
        .WriteText sContent
    End If
    .SaveToFile Server.Mappath("test.html"), 2
    .Close
End With
Set oAdos = Nothing
%>

分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: