本帖最后由 Byboy 于 2015-4-22 21:00 编辑
乱码
[] 纯文本查看 复制代码 public void Submit(string url, bool isBackable = true)
{
HttpResponse response = System.Web.HttpContext.Current.Response;
response.Clear();
if (isBackable)
{
response.Write("<html><head> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\" /></head><body onload=\"pageload();\">");
response.Write("<script language=\"javascript\">function pageload(){if(document.getElementById('hidBackUrl').value.length==0){document.getElementById('hidBackUrl').value=document.referrer;document.form1.submit();}else{location.href=document.getElementById('hidBackUrl').value;}}</script>");
response.Write("<input id=\"hidBackUrl\" type=\"hidden\" value=\"\" />");
}
else
{
response.Write("<html><head></head><body onload=\"document.form1.submit();\">");
}
response.Write(string.Format("<form name=\"form1\" method=\"post\" action=\"{0}\">", url));
foreach (string key in this.Keys)
{
response.Write(string.Format("<input name=\"{0}\" type=\"hidden\" value=\"{1}\" />", key, this[key]));
}
response.Write("</form></body></html>");
response.End();
}
目标网站gb2312
|