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

ASP小偷程序 读取UTF-8 乱码求解???

=============================== 下面的主页index.asp的内容 =============================== <!--#Include File="Config.asp"--> <% If Request.QueryString("Demo")<>"" Then PageCode=GetHttpPage(Request.QueryString("Demo")) Else PageCode=GetHttpPage("http://wenwen.zzzyk.com/") End If PageCodes=PageCode PageCode=ReplaceTest("<script(.|\n)*?</script>","",PageCodes) Response.Write(PageCode) %> =============================== Config.asp 的内容 =============================== <% '定义系统参数 Option Explicit Dim SiteName,SiteUrl,SiteOpen,SiteCloseStr,i Dim PageCode,PageCodes dim Conn,Rs,Sqlstr,top SiteName="" '站点名称 SiteUrl="" '站点路径 SiteOpen=True '站点是否开放,Ture为开放,False为关闭 SiteCloseStr="站点升级中!请稍候访问。。。" '站点关闭时显示的提示 top="" '========================================== '判断站点是否开启 '========================================== If SiteOpen=False Then Response.Write(SiteCloseStr) Response.End() End If '========================================== '正则表达式函数区 '========================================== Function ReplaceTest(patrn,replStr,str) Dim regEx,str1 str1=str Set regEx = New RegExp regEx.Pattern = patrn regEx.IgnoreCase = True regEx.Global = True ReplaceTest = regEx.Replace(str1,replStr) End Function Function RegExpTest(patrn, strng) Dim regEx, Matchs, Matches, RetStr Set regEx = New RegExp regEx.Pattern = patrn regEx.IgnoreCase = True regEx.Global = True Set Matches = regEx.Execute(strng) For Each Matchs in Matches RetStr = RetStr & Matchs.Value & "||" Next RegExpTest = RetStr End Function '========================================== '采集函数区 '========================================== '获取页面源代码函数 Function GetHttpPage(HttpUrl) If IsNull(HttpUrl)=True Then Response.Write("请输入网址!") Exit Function End If Dim Http Set Http=server.createobject("MSX"&"ML2.XML"&"HTTP") Http.open "GET",HttpUrl,False Http.Send() If Http.Readystate<>4 then Set Http=Nothing response.Write("该网页无法访问!") Exit function End if GetHttpPage=BytesToBSTR(Http.responseBody,"GB2312") Set Http=Nothing If Err.number<>0 then Err.Clear Response.Write(SiteCloseStr) Response.End() End If End Function '转换编码函数 Function BytesToBstr(Body,Cset) Dim Objstream Set Objstream = Server.CreateObject("adod"&"b.stream") Objstream.Type = 1 Objstream.Mode =3 Objstream.Open Objstream.Write body Objstream.Position = 0 Objstream.Type = 2 Objstream.Charset = Cset BytesToBstr = Objstream.ReadText Objstream.Close set Objstream = nothing End Function %> 要怎么改哦 ??我是新手 最好帮我改好。 西西!!
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,