tto : wuyq11
StringBuilder builder = new StringBuilder();
builder.Append("<form name='kqPay' method='post' action='https://www.xtgl.com/gway/infoAction.htm'>");
builder.Append("<input type='hidden' id='inputCharset' runat='server' NAME='inputCharset' value='" + inputCharset + "'>“)
builder.Append("</form><script language='javascript'>document.getElementById('kqPay').submit();</script>"); Response.Clear();
Response.Write(builder.ToString());
Response.End();类似于这样的代码
IE肯定是可以跳转的。。其他浏览器都不行。
StringBuilder builder = new StringBuilder();
builder.Append("<form name='kqPay' method='post' action='https://www.xtgl.com/gway/infoAction.htm'>");
builder.Append("<input type='hidden' id='inputCharset' runat='server' NAME='inputCharset' value='" + inputCharset + "'>“)
builder.Append("</form><script language='javascript'>document.getElementById('kqPay').submit();</script>"); Response.Clear();
Response.Write(builder.ToString());
Response.End();类似于这样的代码
IE肯定是可以跳转的。。其他浏览器都不行。
Response.Write(vUrl); 都是没问题。可以跳转
你点击右键,查看源代码看看
Response.Write("<script language='javascript'>location.href='';</script>");直接挑战
builder.Append("<form name='kqPay' method='post' action='https://www.xtgl.com/gway/infoAction.htm'>");
builder.Append("<input type='hidden' id='inputCharset' runat='server' NAME='inputCharset' value='" + inputCharset + "'>“)
builder.Append("</form><script language='javascript'>document.getElementById('kqPay').submit();</script>");就是 builder.ToString() 里面的代码
前几年代码都放在服务器上好好的。都没啥问题。就今天发现其他浏览器不能跳转。
public string postData(string url,string param)
{
string str = string.Empty;
try
{
Encoding myEncoding = Encoding.GetEncoding("gb2312");
byte[] bs = myEncoding.GetBytes(param);
HttpWebRequest req = WebRequest.Create(url) as HttpWebRequest;
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded;";
req.ContentLength = bs.Length;
using (Stream reqStream = req.GetRequestStream())
{
reqStream.Write(bs, 0, bs.Length);
}
using (WebResponse wr = req.GetResponse())
{
System.IO.Stream responseStream = wr.GetResponseStream();
System.IO.StreamReader reader = new System.IO.StreamReader(responseStream, myEncoding);
str = reader.ReadToEnd();
}
}
catch (Exception ex)
{
str = ex.Message;
}
return str;
}