DotBBS.Common/CommUtil.cs

(开头部分) 13KB

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

using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Text.RegularExpressions;
using System.Configuration;
using System.Web.Security;

//============================================================================
// 官方支持:DotBBS.Net   作者:吸铁石团队(水煮鱼)
//============================================================================
namespace DotBBS.Common
{
    /// <summary>
    /// 常用方法
    /// </summary>
    public class CommUtil
    {
        /// <summary>
        /// 获取一个小数的整数部分
        /// </summary>
        /// <param name="num"></param>
        /// <returns></returns>
        public static int GetInt(int num)
        {
            string[] arr = num.ToString().Split('.');
            return int.Parse(arr[0]);
        }

        /// <summary>
        /// 过滤非法字符
        /// </summary>
        /// <param name="filterString"></param>
        /// <param name="exclueStr">排除的字符串,","分割如 ".,-,"</param>
        /// <returns></returns>
        public static string SafeFilter(string str,string exclueStr)
        {
            str = str.Replace(" ","");
            if (exclueStr.IndexOf("',") < 0)
            {
                str = str.Replace("'", "");
            }
            if (exclueStr.IndexOf(",,") < 0)
            {
                str = str.Replace(",", "");
            }
            if (exclueStr.IndexOf("-,") < 0)
            {
                str = str.Replace("-", "");
            }
            if (exclueStr.IndexOf("+,") < 0)
            {
                str = str.Replace("+", "");
            }
            if (exclueStr.IndexOf("%,") < 0)
            {
                str = str.Replace("%", "");
            }
            if (exclueStr.IndexOf("&,") < 0)
            {
后面还有 352 行代码,购买后查看完整代码

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

AI 解读 AI

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

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