Own.Utils/StringHelper.cs

(开头部分) 15KB

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

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;

namespace Own.Utils
{
    public class StringHelper
    {
        public static string LDAPSpecialCharacterReplace(string accountName)
        {//.Replace(@",", "_")
            return accountName.Replace(@"/", "_").Replace(@"\", "_").Replace(@"[", "_").Replace(@"]", "_")
                .Replace(@":", "_").Replace(@";", "_").Replace(@"|", "_").Replace(@"=", "_")
                .Replace(@"+", "_").Replace(@"*", "_").Replace(@"?", "_").Replace(@"<", "_").Replace(@">", "_");
        }

        /// <summary>
        /// 过滤特殊字符串为空,防止对AD 2016.01.14
        /// </summary>
        /// <param name="accountName"></param>
        /// <returns></returns>
        public static string LDAPSpecialCharacterReplaceNew(string accountName)
        {
            return accountName.Replace(@"(", "").Replace(@")", "").Replace(@">", "").Replace(@"<", "")
                .Replace(@":", "").Replace(@";", "").Replace(@"|", "").Replace(@"=", "")
                .Replace(@"+", "").Replace(@"*", "").Replace(@"?", "");
        }

        #region 构造函数
        /// <summary>
        /// 构造函数
        /// </summary>
        public StringHelper()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        #endregion

        #region 生成随机的数字
        /// <summary>
        /// 生成随机的数字
        /// </summary>
        /// <param name="intLength">生成字母的个数</param>
        /// <returns>string</returns>
        public static string GenerateRndNum(int intLength)
        {
            string Vchar = "0,1,2,3,4,5,6,7,8,9";
            string[] VcArray = Vchar.Split(',');
            string VNum = ""; //由于字符串很短,就不用StringBuilder了

            int temp = -1; //记录上次随机数值,尽量避免生产几个一样的随机数

后面还有 344 行代码,购买后查看完整代码

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

AI 解读 AI

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

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