asp.net遍歷request.form 值
for (int i = 0; i < Request.Form.Count; i++) {
if (Request.Form.Keys[i].ToString().Substring(0,1)!="_")
Response.Write(Request.Form.Keys[i].ToString() + " = " + Request.Form[i].ToString());
}
for(int i = 0;i<Request.Params.Count;i++)
Response.Write("<li>" + Request.Params.Keys[i].ToString() + " = " + Request.Params[i].ToString());
Response.Write("<hr>");
for(int i = 0;i<Request.Form.Count;i++)
Response.Write("<li>" + Request.Form.Keys[i].ToString() + " = " + Request.Form[i].ToString());
Response.Write("<hr>");
for(int i = 0;i<Request.QueryString.Count;i++)
Response.Write("<li>" + Request.QueryString.Keys[i].ToString() + " = " + Request.QueryString[i].ToString());
Response.Write("<hr>");
for(int i = 0;i<Request.Cookies.Count;i++)
Response.Write("<li>" + Request.Cookies.Keys[i].ToString() + " = " + Request.Cookies[i].ToString());
#region 【讀取列表網址URL引數】 recordModel.record_url = HttpContext.Current.Request.UrlReferrer.ToString(); if (HttpContext.Current.Request.Form.Count != 0) { bool _urlcs = true; for (int i = 0; i < HttpContext.Current.Request.Form.Count; i++) { if(HttpContext.Current.Request.Form[i] != "") { if (_urlcs) { _urlcs = false; recordModel.record_url += "#"; } else { recordModel.record_url += "&"; } recordModel.record_url += HttpContext.Current.Request.Form.Keys[i] + "=" + HttpContext.Current.Request.Form[i]; } } } #endregion