zoukankan      html  css  js  c++  java
  • 获取页面所有参数

    using System.Collections.Specialized; 

    LogHelper.GetInstance().WriteMessage("==============================================================================start");
                NameValueCollection nvc = Request.Form;
                NameValueCollection nvc1 = Request.Params;
                //Params可以获取这三个集合的参数,不过一般不这么用,这个集合比较大,性能不好。所有我们平时都用具体的,要么Form,要么QueryString
                //获取 System.Web.HttpRequest.QueryString、
                //System.Web.HttpRequest.Form、
                //System.Web.HttpRequest.ServerVariables
                
                string[] keys = nvc.AllKeys;
                if (keys == null || keys.Length <= 0)
                {
                    LogHelper.GetInstance().WriteMessage("Request.Form参数Length为0");
                }
                foreach (string k in keys)
                {
                    string key = k;
                    string value = Request.Form[k];
                   
                    LogHelper.GetInstance().WriteMessage(string.Format("Request From key:{0},{2},Value:{1}{2}",key,value,Environment.NewLine));//加个换行符
                
                }

                LogHelper.GetInstance().WriteMessage("==============================================================================end");

  • 相关阅读:
    kafka 学习笔记
    awk命令详解
    apache 的 配置项
    Apache 的 httpd.conf 详解
    如何设置httpd-mpm-conf的参数
    apache 服务器概述--安装(一)
    centos 修改时区
    docker(三)docker镜像和镜像发布方法
    docker(二)部署docker容器虚拟化平台
    sql的存储过程使用详解--基本语法
  • 原文地址:https://www.cnblogs.com/zttb/p/9300416.html
Copyright © 2011-2022 走看看