国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發(fā)設計 > 正文

ASP.NET 取得客戶端信息

2019-11-18 19:09:11
字體:
供稿:網(wǎng)友

using System.Collections.Specialized  

int loop1, loop2;
   NameValueCollection coll;
 
   // Load ServerVariable collection into NameValueCollection object.
   coll=Request.ServerVariables;
   // Get names of all keys into a string array.
   String[] arr1 = coll.AllKeys;
   for (loop1 = 0; loop1 < arr1.Length; loop1++)
   {
    Response.Write("Key: " + arr1[loop1] + "<br>");
    String[] arr2=coll.GetValues(arr1[loop1]);
    for (loop2 = 0; loop2 < arr2.Length; loop2++)
    {
     Response.Write("Value " + loop2 + ": " + arr2[loop2] + "<br>");
    }
   }


====以下是一個取得ip操作系統(tǒng)以及瀏覽器的例子=========

PRivate string getIp()
{/*穿過代理服務器取遠程用戶真實IP地址:*/
if(Request.ServerVariables["HTTP_VIA"]!=null)
return Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();
else
return Request.ServerVariables["REMOTE_ADDR"].ToString();
}
Label2.Text =getIp();
HttpBrowserCapabilities bc = new HttpBrowserCapabilities();
bc = Request.Browser;
string xitong ="你的操作系統(tǒng)為";
Label3.Text=xitong+bc.Platform + " 瀏覽器類型:" + bc.Type;


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 洪泽县| 静乐县| 松溪县| 古蔺县| 东丽区| 景泰县| 胶南市| 都安| 安徽省| 涿州市| 商洛市| 柞水县| 海晏县| 松桃| 疏附县| 阿城市| 大冶市| 南召县| 亳州市| 高陵县| 如东县| 万宁市| 礼泉县| 涟源市| 石景山区| 博湖县| 肥西县| 沾益县| 古丈县| 武鸣县| 霍城县| 通河县| 资源县| 德阳市| 剑阁县| 鄄城县| 崇左市| 泾川县| 柳州市| 孝昌县| 双流县|