zoukankan      html  css  js  c++  java
  • string path;

      public static string Encrypt(UserPasswordFormat format, string cleanString, string salt)
      {
       Byte[] clearBytes;
       Byte[] hashedBytes;
       Encoding encoding = Encoding.GetEncoding("unicode");
       clearBytes = encoding.GetBytes(salt.ToLower().Trim() + cleanString.Trim());

       hashedBytes = ((HashAlgorithm) CryptoConfig.CreateFromName("MD5")).ComputeHash(clearBytes);

         return BitConverter.ToString(hashedBytes);
         ;                     
       
      }
      public static Common GetConfig()
      {
       Common config = cache.Get(CacheKey) as Common;
       if(config == null)
       {
        string path;
        if(HttpContext.Current != null)
         path = HttpContext.Current.Server.MapPath("~/Forums.config");
        else
         path = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar + "Forums.config";

        XmlDocument doc = new XmlDocument();
        doc.Load(path);
        config = new Common(doc);
        cache.Insert(CacheKey,config,new CacheDependency(path),DateTime.MaxValue,TimeSpan.Zero,CacheItemPriority.AboveNormal,null);

        //cache.ReSetFactor(config.CacheFactor);
       }
       return config;
               
      }

  • 相关阅读:
    父子组件例子
    指令
    使用git将代码推到coding
    vue生命周期
    vue 父子组件
    vuex
    使用vue与element组件
    vue02
    使用vue
    telnet 使用
  • 原文地址:https://www.cnblogs.com/sujingnan/p/963770.html
Copyright © 2011-2022 走看看