asp寫Web代理軟件,可以用作突破網關限制等,主要是為了配合Ajax使用的(因Firefox存在跨域訪問的問題) 版本0.1 作者LlinZzi
功能
判斷網站編碼,支持任何語言
超連接自動轉換
附帶一個遠程下載圖片的函數
未解決問題,目前只能用來代理網站代碼,圖片等其他數據的代理轉發尚未完成。
複製代碼代碼如下:
<%@LANGUAGE="JAVASCRIPT"CODEPAGE="65001"%>
<%Response.Charset="utf-8"%>
<%
Server.ScriptTimeout=9999999;
varSurl=String(Request.QueryString("url"));
if(Surl=="undefined"){
Response.Write("<pstyle=/"font-size:9pt;margin:30px;padding:10px;text-align:center;background-color:#FFCCCC;border:1pxsolid#999999;/">Asp代理byLlinzzi</p>");
Response.Write("<divstyle=/"font-size:9pt;margin:30px;text-align:center;background-color:#FFFFCC;border:1pxsolid#999999;/">");
Response.Write("<formaction=/"#/"method=/"get/">");
Response.Write("<pstyle=/"font-size:9pt;margin:5px;text-align:center;/">請輸入網址</p>");
Response.Write("<p><inputstyle=/"background-color:#FFCCCC;border:1pxsolid#999999;/"type=/"text/"name=/"url/"></p>");
Response.Write("<p><inputstyle=/"background-color:#FFCCCC;border:1pxsolid#999999;/"type=/"submit/"value=/"GoWeb/"></p>");
Response.Write("</div>");
}
elseif(Surl==""){
Response.Write("<pstyle=/"font-size:9pt;margin:30px;padding:10px;text-align:center;background-color:#FFCCCC;border:1pxsolid#999999;/">Asp代理byLlinzzi</p>");
Response.Write("<divstyle=/"font-size:9pt;margin:30px;text-align:center;background-color:#FFFFCC;border:1pxsolid#999999;/">");
Response.Write("<p>地址為空,請格式輸入如www.tom.com</p>");
Response.Write("</div>");
}
else{
Surl=(Surl.substr(0,7)!="http://")?"http://"+Surl:Surl;
Response.Write(send_request(Surl));
}
functionsend_request(url){
varcodedtext;
http_request=Server.CreateObject("Microsoft.XMLHTTP");
try{
http_request.Open("GET",url,false);
http_request.Send(null);
}
catch(e)
{
Response.Write(e.description);
}
if(http_request.ReadyState==4){
//自動判斷編碼開始