日期:2014-05-18 浏览次数:20453 次
/// <summary> /// 模拟Get提交数据 /// </summary> /// <param name="url">Get地址</param> /// <returns></returns> public static string CreateGetHttpResponse(string url) { var request = (HttpWebRequest)WebRequest.Create(url); request.Method = "GET"; request.ContentType = "text/html;charset=gb2312"; var response = (HttpWebResponse)request.GetResponse(); var myResponseStream = response.GetResponseStream(); var myStreamReader = new StreamReader(myResponseStream, Encoding.GetEncoding("gb2312")); string retString = myStreamReader.ReadToEnd(); myStreamReader.Close(); myResponseStream.Close(); return retString; }
------解决方案--------------------
Session
cookies
------解决方案--------------------
JS+ajax
------解决方案--------------------
用JQuery的$.post和$.get都可以实现不刷新页面传值
------解决方案--------------------
可以使用表单提交,跨页投递,或者ajax的方式。方法太多了。
------解决方案--------------------
用session 就行了
最简单的