在服务端获取从客户端发送过来的所有数据信息;
#方案: 1、服务端代码1 public void ProcessRequest(HttpContext context) 2 { 3 //打印所有参数信息 4 context.Response.Write("Params:"); 5 for (int i = 0; i < context.Request.Params.Count; i++) 6 { 7 context.Response.Write("<li>" + context.Request.Params.Keys[i].ToString() + " = " + context.Request.Params[i].ToString()); 8 } 9 context.Response.Write("<hr>"); 10 //打印form信息 11 context.Response.Write("Form:"); 12 for (int i = 0; i < context.Request.Form.Count; i++) 13 { 14 context.Response.Write("<li>" + context.Request.Form.Keys[i].ToString() + " = " + context.Request.Form[i].ToString()); 15 } 16 context.Response.Write("<hr>"); 17 //打印query信息 18 context.Response.Write("QueryString:"); 19 for (int i = 0; i < context.Request.QueryString.Count; i++) 20 { 21 context.Response.Write("<li>" + context.Request.QueryString.Keys[i].ToString() + " = " + context.Request.QueryString[i].ToString()); 22 } 23 context.Response.Write("<hr>"); 24 //打印cookies信息 25 context.Response.Write("Cookies:"); 26 for (int i = 0; i < context.Request.Cookies.Count; i++) 27 { 28 context.Response.Write("<li>" + context.Request.Cookies.Keys[i].ToString() + " = " + context.Request.Cookies[context.Request.Cookies.Keys[i].ToString()].Value); 29 } 30 context.Response.ContentType = "text/html"; 31 }