Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It's probably easiest to just abstract your hash-cracker method out:</p> <pre><code>Function hashType(ByVal filename As String) As Boolean If algo.Text = "MD5" Then Dim firstWord = (From word In IO.File.ReadLines(filename) Where String.Equals(MD5(word), hash.Text)).FirstOrDefault() If firstWord IsNot Nothing Then Label2.Text = firstWord Return True Else Label2.Text = "Hash Could Not Be Cracked" End If ElseIf algo.Text = "SHA1" Then Dim firstWord = (From word In IO.File.ReadLines(filename) Where String.Equals(SHA1(word), hash.Text)).FirstOrDefault() If firstWord IsNot Nothing Then Label2.Text = firstWord Return True Else Label2.Text = "Hash Could Not Be Cracked" End If End If Return False End Function Private Sub Thief3Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Thief3Button1.Click OpenFileDialog1.Filter = "Dictionaries (*.dic)|*.dic" OpenFileDialog1.FilterIndex = 1 OpenFileDialog1.RestoreDirectory = True OpenFileDialog1.Multiselect = True OpenFileDialog1.ShowDialog() End Sub Private Sub Thief3TopButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Thief3TopButton1.Click Me.Close() End Sub Private Sub Thief3Button3_Click_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Thief3Button2.Click hashType(OpenFileDialog1.FileName) End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load For Each wl As String In File.ReadLines("settings.txt") If hashType(wl) Then Exit For Next End Sub </code></pre> <p>Voil&agrave;. I think you'll probably want to do this somewhere other than in the <code>Load</code> event, though - there won't be anything in <code>hash.Text</code> when the form is first created.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload