Advertisement
Gov_777

StrToMD5 кириллица

Jun 1st, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 KB | None | 0 0
  1. using System.Security.Cryptography;
  2. using System.Text;
  3. using System.Windows.Forms;
  4.  
  5. namespace md5_1
  6. {
  7.     public partial class FMD5 : Form
  8.     {
  9.         public FMD5()
  10.         {
  11.             InitializeComponent();
  12.         }
  13.  
  14.         public string ComputeStringMD5Hash(string instr)
  15.         {
  16.             string strHash = string.Empty;
  17.  
  18.             foreach (byte b in new MD5CryptoServiceProvider().ComputeHash(Encoding.Default.GetBytes(instr)))
  19.             {
  20.                 strHash += b.ToString("X2");
  21.             }
  22.             return strHash.ToLower();
  23.         }
  24.  
  25.         private void button1_Click(object sender, EventArgs e)
  26.         {
  27.             label1.Text = ComputeStringMD5Hash(textBox1.Text);
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement