為什么不能在C#代碼文件中使用Request.ServerVariables [“ALL_HTTP”]?
當(dāng)前位置:點(diǎn)晴教程→知識(shí)管理交流
→『 技術(shù)文檔交流 』
: 為什么不能在C#代碼文件中使用Request.ServerVariables [“ALL_HTTP”]? using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Collections.Specialized; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { NameValueCollection coll; coll = Request.ServerVariables; // Get names of all keys into a string array. String[] arr1 = coll.AllKeys; for (int loop1 = 0; loop1 < arr1.Length; loop1++) { Response.Write("Key: " + arr1[loop1] + "<br>"); String[] arr2 = coll.GetValues(arr1[loop1]); for (int loop2 = 0; loop2 < arr2.Length; loop2++) { Response.Write("Value " + loop2 + ": " + Server.HtmlEncode(arr2[loop2]) + "<br>"); } } } } 該文章在 2023/11/22 11:57:24 編輯過(guò) |
關(guān)鍵字查詢(xún)
相關(guān)文章
正在查詢(xún)... |