驰骋工作流引擎

注册

 

发新话题 回复该主题

MD5 产生的加密值是乱码,怎么回事? [复制链接]

1#
MD5 md5 = new MD5CryptoServiceProvider();
byte[] result = md5.ComputeHash(System.Text.Encoding.Default.GetBytes(s));
string mys= System.Text.Encoding.Default.GetString(result);
return mys;

产生的加密值是乱码,怎么回事?
分享 转发
获取最新动态,请关注企业服务号:chichengsoft

学好ccflow,受益一生,多看文档,少走弯路。
TOP
2#

  1.             /// <summary>
  2.             /// MD5加密,返回MD5 16位或32位加密后的字符串,默认返回16位。code输入16或32
  3.             /// </summary>
  4.             /// <param name="str">原始字符串</param>
  5.             /// <param name="code">MD5返回16位还是32位?请输入16或32</param>
  6.             public static string MD5Encrypt(string str, int code)
  7.             {
  8.                 if (code == 16) //16位MD5加密(取32位加密的9~25字符)
  9.                 {
  10.                     return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5").ToLower().Substring(8, 16);
  11.                 }
  12.                 else if (code == 32) //32位加密  
  13.                 {
  14.                     return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5").ToLower();
  15.                 }
  16.                 else
  17.                 {
  18.                     return "0000000000000000";
  19.                 }
  20.             }
  21.             /// <summary>
  22.             /// MD5加密,返回MD5 16位或32位加密后的字符串,默认返回16位。
  23.             /// </summary>
  24.             /// <param name="str">原始字符串</param>
  25.             public static string MD5Encrypt(string str)
  26.             {
  27.                 return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5").ToLower().Substring(8, 16);
  28.             }
复制代码

    已有1评分我要评分查看所有评分

    ██████████████████████████████████████████████████
    ██████████████████████████████████████████████████

    【IT大师www.ITdos.com
    【IT大师以往ccflow的所有帖子】
    █【http://bbs.ccflow.org/search.aspx?searchid=111021

    ██████████████████████████████████████████████████
    ██████████████████████████████████████████████████
    TOP
    3#

    该用户帖子内容已被屏蔽
    TOP
    4#

    adidas trainers uk
    coach bags
    oakley vault
    columbia outlet
    coach factory outlet
    christian louboutin sneakers
    coach outlet store online
    clarks outlet
    ferragamo outlet
    mlb jerseys custom
    longchamp handbags
    ed hardy clothing
    under armour shoes
    adidas nmd xr1
    prada bags
    ray ban wayfarer
    nike cortez classic
    adidas nmd r1
    oakley sunglasses
    gucci outlet
    coach outlet
    ray ban solbriller online
    longchamp outlet
    adidas outlet
    mcm handbags
    nfl jerseys wholesale
    nike factory store
    christian louboutin heels
    kobe 11 shoes
    nike jordan shoes
    paul pogba jersey
    pandora charms sale clearance
    north face
    kobe shoes
    north face jackets
    ugg outelt
    michael kors handbags clearance
    air jordan shoes
    michael kors outlet clearance
    adidas nmd runner
    snapback hats
    fitflops sale
    prada bags
    coach outlet store online
    nike store uk
    fitflops sandals
    lebron shoes
    michael kors outlet online
    yeezy boost 350
    cheap jordans
    columbia outlet store
    ralph lauren polo
    ralph lauren polo
    vans for sale
    michael kors handbags
    michael kors outlet
    pandora bracelet
    oakley sunglasses outlet
    north face outlet
    polo outlet
    michael kors handtaschen
    ray ban eyeglasses
    coach handbags
    cheap jordan shoes
    adidas yeezy boost 350 pirate black
    hermes handbags
    nike blazer
    nike roshe run women
    adidas outlet store
    kate spade handbags
    cheap nba jerseys
    michael kors bags
    michael kors outlet online
    coach purses
    adidas zx 700
    fitflops shoes
    adidas originals superstar
    burberry outlet
    coach factory online
    cheap jordan shoes
    michael kors outlet
    coach outlet store online clearances
    longchamp bags
    salvatore ferragamo belt
    coach bags
    cheap jordans
    nike sb dunks
    michael kors handbags
    new balance 990
    fitflops sale clearance
    mk väska
    adidas neo label
    nike roshe run
    michael kors outlet
    polo ralph lauren outlet
    discount ray ban sunglasses
    adidas soccer cleats
    michael kors handbags
    polo shirts
    ugg boots clearance
    converse all star
    nike roshe run
    adidas yeezy boost 350 v2
    ferragamo outlet
    hzx20170608qu
    TOP
    发新话题 回复该主题