Answer the question
In order to leave comments, you need to log in
Why is it incorrectly written to textBox?
private void metroButton3_Click(object sender, EventArgs e)
{
string text = textBox1.Text;
textBox1.Text = "";
String[] textOnChars = text.Split(new char[] {'\n'}, StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < textOnChars.Length; i++)
{
string crypted = EncryptText(textOnChars[i]);
textBox1.Text += textOnChars[i] + " - " + crypted + "\n";
}
}
public static string EncryptText(string originalPassword)
{
Byte[] originalBytes;
Byte[] encodedBytes;
MD5 md5;
md5 = new MD5CryptoServiceProvider();
originalBytes = ASCIIEncoding.Default.GetBytes(originalPassword);
encodedBytes = md5.ComputeHash(originalBytes);
return System.Text.RegularExpressions.Regex.Replace(BitConverter.ToString(encodedBytes), "-", "").ToLower();
}
введённое число - полученный хэш
введённое число - полученный хэш
введённое число - полученный хэш
...
123 - 411598a4370c524b67fce41973bdd401123 -
411598a4370c524b67fce41973bdd401123 - 202cb962ac59075b964b07152d234b70
Answer the question
In order to leave comments, you need to log in
I'm stupid... :/
decided like this:
It was necessary to add "\r\n" to the beginning, because when debugging, I noticed that they are sorted not by \n, but also by the symbol \r, in general,
sorry for the spam, I honestly didn’t know, after the question I went to debug and decided right away :\ leave, MB someone will need
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question