private void cmbHashType_SelectionChanged(object sender, SelectionChangedEventArgs e) { var fhasher = new FileHasher(); var item = (ComboBoxItem)e.AddedItems[0]; string text = item.Content.ToString(); if (fullFilePath == "") { //we do not have a file to hash...user must be entering a hash manually... //TODO: determine what hash they are entering. return; } if (text == "MD5") { //set to md5 hash txtBxFileHash.Text = fhasher.getFileHashMd5(fullFilePath); } if (text == "Sha256") { //set to md5 hash txtBxFileHash.Text = fhasher.getFileHashSha256(fullFilePath); } }
private void Button_Click(object sender, RoutedEventArgs e) { if (txtBoxHash.Text != "") { FileHasher hasher = new FileHasher(); FileHashedPrompt prompt = new FileHashedPrompt(hasher.compareHash(fullFilePath, txtBoxHash.Text)); prompt.ShowDialog(); this.Close(); } }
private void cmbHashType_SelectionChanged(object sender, SelectionChangedEventArgs e) { var fhasher = new FileHasher(); var item = (ComboBoxItem)e.AddedItems[0]; string text = item.Content.ToString(); if (text == "MD5") { //set to md5 hash // txtBxFileHash.Text = fhasher.getFileHashMd5(txtBxFileName.Text); } if (text == "Sha256") { //set to md5 hash // txtBxFileHash.Text = fhasher.getFileHashSha256(txtBxFileName.Text); } }
private string GetFileHash(string path) { var fhasher = new FileHasher(); return(fhasher.getFileHashSha256(path)); }