// Token: 0x06000061 RID: 97 RVA: 0x00008ED4 File Offset: 0x000070D4
        private bool GetHash(ref string file, ref string hash)
        {
            bool result;

            try
            {
                OpenFileDialog openFileDialog = new OpenFileDialog();
                if (DialogResult.OK == openFileDialog.ShowDialog())
                {
                    file = openFileDialog.FileName;
                    byte[] ba = File.ReadAllBytes(openFileDialog.FileName);
                    hash   = CryptoExpress.Sha256Hash(ba);
                    result = true;
                }
                else
                {
                    result = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("File not valid.\r\n\r\n" + ex.ToString());
                result = false;
            }
            return(result);
        }
Exemple #2
0
 private bool GetHash(ref string file, ref string hash)
 {
     try
     {
         var f = new OpenFileDialog();
         if (DialogResult.OK == f.ShowDialog())
         {
             file = f.FileName;
             var ba = File.ReadAllBytes(f.FileName);
             hash = CryptoExpress.Sha256Hash(ba);
             return(true);
         }
         return(false);
     }
     catch (Exception ex)
     {
         MessageBox.Show("File not valid.\r\n\r\n" + ex);
         return(false);
     }
 }