Conris.Utility/StringHelper.cs

(开头部分) 16KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Security;
using Conris.Utility;

namespace Conris.Utility
{
    /// <summary>
    /// 字符操作类
    /// </summary>
    public class StringHelper
    {
        public StringHelper() { }


        public static int GetIntPara(string paraName)
        {
            int result = 0;

            string s = HttpContext.Current.Request.QueryString[paraName];
            if (s != null && Utility.Validate.IsInt(s))
                result = int.Parse(s);
            return result;
        }

        public static decimal GetDecimalPara(string paraName)
        {
            decimal result = 0;

            string s = HttpContext.Current.Request.QueryString[paraName];
            if (s != null && Utility.Validate.IsDecimal(s))
                result = decimal.Parse(s);
            return result;
        }


        public static string GetStrPara(string paraName)
        {
            string s = HttpContext.Current.Request.QueryString[paraName];
            if (!string.IsNullOrEmpty(s))
                return SQLFix(s);
            else
                return "";
        }


        public static string SQLFix(string input)
        {
            string s = input.Replace("'", "");
            s = s.Replace("`", "");
            s = s.Replace("--", "");
            return s;
        }

        /// <summary> 
        /// 过滤数据库禁用字符
后面还有 374 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。