Advertisement
Guest User

Untitled

a guest
Aug 28th, 2021
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.73 KB | None | 0 0
  1.         private void button1_Click(object sender, EventArgs e)
  2.         {
  3.  
  4.             bool bool_0 = true;
  5.             bool bool_1 = true;
  6.             string str = RandomString(6);
  7.             string str2 = "Typical";
  8.             string str3 = bool_0 ? string.Format("{0}_{1}", "Fotosizer Professional v2", "5D4F30AD-0ADD-4703-B0A0-BA72F0FCB164") : "Fotosizer Professional v2";
  9.             string str4 = smethod_16(string.Format("{0}{1}{2}", str, str2, str3), bool_1).Substring(0, 14).ToUpper();
  10.             textBox1.Text = string.Format("{0}{1}-{2}-{3}", new object[] { str, str4.Substring(0, 2), str4.Substring(2, 4), smethod_0(str4, 8) });
  11.            
  12.         }
  13.  
  14.  
  15.         private static string smethod_16(string string_7, bool bool_0)
  16.         {
  17.             string str = string.Empty;
  18.             byte[] bytes = Encoding.ASCII.GetBytes(string_7);
  19.             try
  20.             {
  21.                 byte[] buffer2;
  22.                 if (bool_0)
  23.                 {
  24.                     buffer2 = new SHA1CryptoServiceProvider().ComputeHash(bytes);
  25.                 }
  26.                 else
  27.                 {
  28.                     buffer2 = MD5.Create().ComputeHash(bytes);
  29.                 }
  30.                 StringBuilder builder = new StringBuilder();
  31.                 for (int i = 0; i < buffer2.Length; i++)
  32.                 {
  33.                     builder.Append(buffer2[i].ToString("X2"));
  34.                 }
  35.                 str = builder.ToString();
  36.             }
  37.             catch (Exception exception1)
  38.             {
  39.                
  40.             }
  41.             return str;
  42.         }
  43.  
  44.         public static string smethod_0(string string_0, int int_0)
  45.         {
  46.             return string_0.Substring(string_0.Length - int_0, int_0);
  47.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement