110,533
社区成员
发帖
与我相关
我的任务
分享
string webUrl = "https://passport.TEST.com/1.asp?name=123&password=123";
HttpWebResponse res = null;
HttpWebRequest req = null;
req = (HttpWebRequest)WebRequest.Create(webUrl);
req.AllowAutoRedirect = true;
req.CookieContainer = new CookieContainer();
res = (HttpWebResponse)req.GetResponse();
StreamReader strm = new StreamReader(res.GetResponseStream(),
Encoding.GetEncoding(54936));
String sContent, sTitle;
sContent = strm.ReadToEnd();
strm.Close();
<html><head><title>用户登录 </title>
<meta http-equiv=content-type content="text/html; charset=gb2312">
<META http-equiv='Pragma' content='no-cache'>
</head>
<body>
<script>
var url="./"
url=url.replace(/^\.\//gi,"http://home.test.com/");
location.href=url;
</script>
</body>
</html>