csharp: Request.Form,Request.QueryString,Request.Params

简介: /// <summary> /// Request.Form,Request.QueryString,Request.Params /// http://msdn.microsoft.com/en-us/library/system.web.httprequest.params(v=vs.110).aspx /// Geov
/// <summary>
        /// Request.Form,Request.QueryString,Request.Params
        /// http://msdn.microsoft.com/en-us/library/system.web.httprequest.params(v=vs.110).aspx
        /// Geovin Du  涂聚文
        /// 2014-05-28
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button1_Click(object sender, EventArgs e)
        {
            GeovinduVip.Common.ProcessRequest pr = new GeovinduVip.Common.ProcessRequest();

            // Create a string to contain the paramaters'
            // information.
            string paramInfo = "";

            // Obtain a reference to the Request.Params
            // collection.
            NameValueCollection pColl = Request.Params;

            // Iterate through the collection and add
            // each key to the string variable.
            for (int i = 0; i <= pColl.Count - 1; i++)
            {
                paramInfo += "Key: " + pColl.GetKey(i) + "<br />";

                // Create a string array that contains
                // the values associated with each key.
                string[] pValues = pColl.GetValues(i);

                // Iterate through the array and add
                // each value to the string variable.
                for (int j = 0; j <= pValues.Length - 1; j++)
                {
                    paramInfo += "Value:" + pValues[j] + "<br /><br />";
                    if (!string.IsNullOrEmpty(pValues[j].ToString()))
                    {
                        if (ProcessSqlStr(pValues[j].ToString(), 1) == false)  //pr.ProcessSqlStr
                        {
                            Jscript.Alert("存在非法字符!");
                            //Response.End();
                            //return;
                        }
                    }


                }
            }

            // Set a Label's Text property to the values
            // contained in the string variable.
            //Response.Write(paramInfo);


            Response.Write("Request.Form.AllKeys:");
            //Request.Form.AllKeys;

            string[] FormColl = Request.Form.AllKeys;

            for (int j = 0; j <= FormColl.Length - 1; j++)
            {
                Response.Write(FormColl[j].ToString()+"="+ Request.Form[FormColl[j]] +  "<br />");
                Response.Write( "<br />");
            }

            Response.Write("Request.Form:");

            foreach (string key in Request.Form.Keys)
            {
                Response.Write(key+"="+Request.Form[key] + "<br />");
            }
            Response.Write("Request.Form:End <br/>");

            Response.Write("Request.QueryString:");
            foreach (string key in Request.QueryString.Keys)
            {
                Response.Write(key+"="+Request.QueryString[key] + "<br />");
            }
            Response.Write("Request.QueryString:End <br/>");
            Response.Write("Request.Params:");
            foreach (string key in Request.Params.Keys)
            {
                Response.Write(String.Format("{0}: {1}<br />", key, Request.Params[key]));
            }
        }

目录
相关文章
|
分布式数据库 数据库 Hbase
|
11月前
|
数据管理 jenkins 测试技术
自动化测试框架的设计与实现
在软件开发周期中,测试是确保产品质量的关键步骤。本文通过介绍自动化测试框架的设计原则、组件构成以及实现方法,旨在指导读者构建高效、可靠的自动化测试系统。文章不仅探讨了自动化测试的必要性和优势,还详细描述了框架搭建的具体步骤,包括工具选择、脚本开发、执行策略及结果分析等。此外,文章还强调了持续集成环境下自动化测试的重要性,并提供了实际案例分析,以帮助读者更好地理解和应用自动化测试框架。
|
XML JSON 前端开发
C#使用HttpClient四种请求数据格式:json、表单数据、文件上传、xml格式
C#使用HttpClient四种请求数据格式:json、表单数据、文件上传、xml格式
2342 0
|
Android开发 容器 API
Android 扫码枪监听封装
一、参考 1、常用keycode 一、简述 1、设备:扫码枪其实相当于一个物理输入设备,如果软键盘打开的话能明显感觉到其内容在输入 2、问题: 2.1、不能扫出中文来(可能和扫码枪设备,配置有关系) 2.
2573 0
|
架构师 程序员
互联网大厂程序员岗位职级划分
相信只要是程序员,都有做过对进入大厂的梦。但也有好多小伙伴们,对大厂只了解一些外在的,不是那么了解。所以今天总结一下10家互联网大厂程序员岗位职级划分,让大家更加认清大厂职级,努力晋升,程序员翻身把家当!不要忘记点赞收藏哦~
11615 23
|
存储 算法 C#
『Halcon』基于Halcon的印刷图像质量检测系统
📣读完这篇文章里你能收获到 - 基于Halcon的印刷图像质量检测系统 - 理论算法的讲解 - 系统软硬件实现结构图示
1158 0
『Halcon』基于Halcon的印刷图像质量检测系统
|
存储 缓存 NoSQL
一文搞懂redis
NoSQL泛指非关系型数据库,随着web2.0互联网的诞生,传统的关系型数据库很难对付web2.0大数据时代!尤其是超大规模的高并发的社区,暴露出来很多难以克服的问题,NoSQL在当今大数据环境下发展的十分迅速,Redis是发展最快的。
一文搞懂redis
|
存储 监控 Kubernetes
后Kubernetes时代,带你系统梳理K8S 12大关键特性
导读: Kubernetes如今风靡一时,所有主要的云服务提供商都将其作为部署云原生应用的解决方案。Kubernetes有哪些显著的特性和工具优势,让企业开始接受它?本文作者给出了系统的梳理。 “Action without orchestration is burn out; orchestration w/o action is management.” 没有编排的行动是完蛋的,没有行动的编排是管理,行动加上编排是领导。
1788 0

热门文章

最新文章