Advertisement
Guest User

Untitled

a guest
Jun 5th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.06 KB | None | 0 0
  1. string user = tbnome.Text;
  2.             string pass = tbpass.Text;
  3.  
  4.             System.Security.Cryptography.SHA256Managed crypt = new System.Security.Cryptography.SHA256Managed();
  5.             System.Text.StringBuilder hash = new System.Text.StringBuilder();
  6.          
  7.             byte[] password = crypt.ComputeHash(Encoding.UTF8.GetBytes(pass), 0, Encoding.UTF8.GetByteCount(pass));
  8.  
  9.             if (tbpass.Text.Count()>0 && tbnome.Text.Count()>0)
  10.             {
  11.                 MessageBox.Show("Well Done");
  12. /*
  13.                 //Enviar Username
  14.                 byte[] packetUser = protocolSI.Make(ProtocolSICmdType.USER_OPTION_1, user);
  15.                 Networkstream.Write(packetUser, 0, packetUser.Length);
  16.  
  17.                 //Enviar Password
  18.                 byte[] packetPass = protocolSI.Make(ProtocolSICmdType.USER_OPTION_1, password);
  19.                 Networkstream.Write(packetPass, 0, packetPass.Length);
  20.   */            
  21.                    
  22.  
  23.             }
  24.             else
  25.             {
  26.                 MessageBox.Show("Credenciais Erradas");
  27.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement