zoukankan      html  css  js  c++  java
  • 查看ServerVariables集合

    要看集合里有哪些东西,才知道获取里面的东西。

            private void Page_Load(object sender, System.EventArgs e)
            {
                
    // 在此处放置用户代码以初始化页面
                
    //System.Collections.Specialized.NameObjectCollectionBase m = Request.ServerVariables;
                int loop1, loop2;
                
    // Load ServerVariable collection into NameValueCollection object.
                System.Collections.Specialized.NameValueCollection 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 + "" + Server.HtmlEncode(arr2[loop2]) + "<br>");
                    }
                }

            }
  • 相关阅读:
    Golang 实现简单的 Web 服务器
    Aliyun linux repo文件
    云服务器查看登录ip和本机出口ip
    10个高效Linux技巧及Vim命令对比
    使用mkfs.ext4格式化大容量磁盘
    LINUX SHELL 多个命令一起执行的几种方法
    GPT分区
    3种方法更改Linux系统的主机名(hostname)
    Nginx代理访问RDS
    Centos7安装Docker
  • 原文地址:https://www.cnblogs.com/zkxp/p/352391.html
Copyright © 2011-2022 走看看