918博天堂

Server : Microsoft-IIS/10.0
System : Windows NT EBS-6136 10.0 build 17763 (Windows Server 2016) i586
User : jxgj ( 0)
PHP Version : 7.0.33
Disable Function : passthru,exec,system,shell_exec,proc_open,popen,pcntl_exec,socket_bind,stream_socket_server
Directory :  D:/tmp_aspnet/root/cae6aa2e/15328683/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : D:/tmp_aspnet/root/cae6aa2e/15328683/App_Code.vywp5zcy.21.cs
?#pragma checksum "D:\wwwroot\anlian2025\wwwroot\App_Code\Tools.cs" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "AA1F000BDCF5A0F56E57FDC95C5BF1E253E730EB"

#line 1 "D:\wwwroot\anlian2025\wwwroot\App_Code\Tools.cs"
using System;
using System.Text;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text.RegularExpressions;

namespace basic.Tools
{
    /// <summary>
    /// QZRequest 的提要注明
    /// </summary>
    public class RequestClass
    {
        /// <summary>
        /// 获得指定Url参数的值
        /// </summary>
        /// <param name="strName">Url参数</param>
        /// <returns>Url参数的值</returns>
        public static string GetQueryString(string strName)
        {
            return GetString(strName);
        }
        /// <summary>
        /// 获得指定Url参数的值 转换为int
        /// </summary>
        /// <param name="strName">参数</param>
        /// <param name="intDefault">默认值</param>
        public static int GetQueryInt(string strName, int intDefault)
        {
            int Int = intDefault;
            if (HttpContext.Current.Request.QueryString[strName] == null)
            {
                Int = intDefault;
            }
            else
            {
                try
                {
                    Int = Int32.Parse(HttpContext.Current.Request.QueryString[strName]);
                }
                catch
                {
                    Int = intDefault;
                }
            }
            return Int;
        }
        /// <summary>
        /// 获得指定Url参数的值
        /// </summary> 
        /// <param name="strName">Url参数</param>
        /// <param name="sqlSafeCheck">是否进行SQL安全查抄</param>
        /// <returns>Url参数的值</returns>
        private static string GetString(string strName)
        {
            if (HttpContext.Current.Request.QueryString[strName] == null)
            {
                return "";
            }
            bool bol = true;
            bol = IsSafeString(HttpContext.Current.Request.QueryString[strName].ToLower());
            if (!bol)
            {
                return "";
            }
            return HttpContext.Current.Request.QueryString[strName];
        }
        // 查抄危险字符
        private static bool IsSafeString(string Str)
        {
            string SqlStr = "'|exec|insert|select|delete|update|count|*|chr|mid|master|truncate|char|declare";
            bool ReturnValue = true;
            try
            {
                if (Str != "")
                {
                    string[] anySqlStr = SqlStr.Split('|');
                    foreach (string ss in anySqlStr)
                    {
                        if (Str.IndexOf(ss) >= 0)
                        {
                            ReturnValue = false;
                            break;
                        }
                    }
                }
            }
            catch
            {
                ReturnValue = false;
            }
            return ReturnValue;
        }
    }
}


#line default
#line hidden