<%
function getHTTPPage(url) 
 dim Http,RequestKey,consur
 For Each RequestKey In Request.Form
		if consur<>"" then
			consur=consur &"&"& RequestKey &"="& Request.Form(RequestKey)
		else
			consur=RequestKey &"="& Request.Form(RequestKey)
		end  if
   next
set Http=server.createobject("Microsoft.XMLHTTP") 
if consur="" then
Http.open "GET",url,false
else
Http.open "post",url,false
end if

Http.setRequestHeader  "User-Agent", "NOKIA N95 Java2.0 Symbian OS 6.1 Serier 90[xywap.cn]"
Http.setRequestHeader  "Accept", "text/vnd.wap.wml, application/smil, image/bmp, image/gif, image/jpeg, image/png, image/vnd.wap.wbmp, text/plain, text/vnd.sun.j2me.app-descriptor, application/java-archive, audio/wav, audio/x-wav, audio/midi, audio/x-midi, */*"
Http.setRequestHeader "Accept-Language", "utf-8;q=1.0,en-GB; q=1.0, en; q=0.8"
Http.setRequestHeader "Accept-Encoding", "gzip,deflate"
Http.setRequestHeader "Accept-Charset","utf-8;q=1.0,gb2312;q=0.5,gbk;q=0.5,big5;q=0.5,* "
Http.setRequestHeader "Keep-Alive", "300"
Http.setRequestHeader "connsmssection", "keep-alive"
Http.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
Http.setRequestHeader "Referer", "http://3spp.cn"

Http.send(consur) 

if Http.readystate<>4 then 
exit function 
end if 
getHTTPPage=bytesToBSTR(Http.responseBody,"utf-8")
set http=nothing 
if err.number<>0 then err.Clear 
end function 



Function BytesToBstr(body,Cset) 
dim objstream 
set objstream = Server.CreateObject("adodb.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 




function ClearHtml(str,start,over)

    if len(trim(str))>0 then      
    else      
        exit function      
    end if 
    dim I2

    str=replace(str,vbNewLine,"[vbNewLine]")
    start=replace(start,"[","\[")
    start=replace(start,"]","\]")
    start=replace(start,"|","\|")
    start=replace(start,"^","\^")
    over=replace(over,"[","\[")
    over=replace(over,"]","\]")
    over=replace(over,"|","\|")
    over=replace(over,"^","\^")

    set I2=new regexp      
        I2.global=true

        I2.ignorecase=true'忽略大小写      

        I2.pattern=start & "(.+?)" & over
    	start=replace(start,"\[","[")
    	start=replace(start,"\]","]")
    	start=replace(start,"\|","|")
    	start=replace(start,"\^","^")
   	over=replace(over,"\[","[")
    	over=replace(over,"\]","]")
   	over=replace(over,"\|","|")
  	over=replace(over,"\^","^")
	str=I2.replace(str,start & over)
   
    set I2=nothing
  
    str=replace(str,"[vbNewLine]",vbNewLine)


    ClearHtml=str
     
end function   
%>

