Common/StringUtil.cs

(开头部分) 26KB

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

/**********************************************
 * 类作用:   字符串实用类
 * 建立人:   abaal
 * 建立时间: 2008-09-03 
 * Copyright (C) 2007-2008 abaal
 * All rights reserved
 * http://blog.csdn.net/abaal888
 ***********************************************/

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

namespace Svnhost.Common
{

    /// <summary>
    /// 字符串实用类
    /// </summary>
    public sealed class StringUtil
    {
        private StringUtil()
        {
        }

        public static string md5(string str)
        {
            return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5").Substring(8, 16);
        }

        public static string md5(string str, int length)
        {
            if (length == 16)
                return md5(str);

            return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5");
        }

        public static string GetTags(string tags)
        {
            if (tags == null)
                return null;

            string[] arrTag = tags.Split(",, ".ToCharArray());
            StringBuilder sb = new StringBuilder(arrTag[0]);
            Hashtable hash = new Hashtable();
            hash.Add(arrTag[0], string.Empty);
            for (int i = 1; i < arrTag.Length; i++)
            {
                if (arrTag[i]!=null && arrTag[i] != string.Empty && !hash.Contains(arrTag[i].ToLower()))
                {
                    sb.Append(string.Format(",{0}", arrTag[i]));
                    hash.Add(arrTag[i].ToLower(), string.Empty);
                }
            }

后面还有 770 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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