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;
               
      }

  • 相关阅读:
    java代码,继承。。。主要是传值,赋值。
    java代码继承。。。找出不能继承父类方法的问题
    java代码继承super
    HDU 6114 Chess
    #113. 【UER #2】手机的生产
    uoj 118 赴京赶考
    戏game
    序sort
    迷enc
    Jupyter 同时支持python2、python3 kernel
  • 原文地址:https://www.cnblogs.com/sujingnan/p/963770.html
Copyright © 2011-2022 走看看