zoukankan      html  css  js  c++  java
  • CS文件密码加密类

    private string _PasswordFormat;

            public Security(string PasswordFormat)

            {

                //

                // TODO: 在此处添加构造函数逻辑

                //PasswordFormat

                this._PasswordFormat = PasswordFormat;

            }

     

            public string EncryptPassword(string PasswordString)

            {

                if (_PasswordFormat == "SHA1")

                {

                    return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(PasswordString, "SHA1");

                }

                else

                {

                    if (_PasswordFormat == "MD5")

                    {

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

                    }

                    else

                    {

                        throw new Exception("Error Password Fromat define.");

                    }

                }

            }

  • 相关阅读:
    python基础--文件操作实现全文或单行替换
    python基础7--集合
    python读写json文件
    python基础6--目录结构
    python基础5--模块
    Ubuntu的一些常用快捷键
    ubuntu dpkg 命令详解
    linux(Ubuntu)安装QQ2013
    fcitx-sogoupinyin下载地址和安装
    Ubuntu下装QQ2014
  • 原文地址:https://www.cnblogs.com/gqrbkw/p/3473508.html
Copyright © 2011-2022 走看看