I have this code here:
Code:Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load RefreshList() End Sub Private Sub RefreshList() Dim procs() As System.Diagnostics.Process = System.Diagnostics.Process.GetProcesses Dim f As String 'as from @Visual Vincent's comment: ListBox1.BeginUpdate() ListBox1.Items.Clear() For Each proc As System.Diagnostics.Process In procs f = GetProcessFileName(proc) If f.Length > 0 Then ListBox1.Items.Add(f) ListBox1.Items.Add("MD5: " & GetMD5String(f)) ListBox1.Items.Add(String.Empty) End If Next ListBox1.EndUpdate() End Sub Private Function GetProcessFileName(proc As System.Diagnostics.Process) As String Dim strRet As String = String.Empty Try strRet = proc.MainModule.FileName Catch ex As Exception ' This catch used to ignore "Access is denied" exception. End Try Return strRet End Function Private Function GetMD5String(ByVal strFilename As String) As String Dim cMD5 = System.Security.Cryptography.MD5.Create Dim bytHash As Byte() Dim sb As New System.Text.StringBuilder Dim scanbox As New TextBox scanbox.Text = My.Computer.FileSystem.ReadAllText("viruslist.txt").ToString Using cStream As New IO.FileStream(strFilename, IO.FileMode.Open, IO.FileAccess.Read, IO.FileShare.Read) bytHash = cMD5.ComputeHash(cStream) End Using For Each b In bytHash sb.Append(b.ToString("X2")) Next If scanbox.Text.Contains(sb.ToString) Then MessageBox.Show("Virus Detected!") End If Return sb.ToString End Function Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick Timer1.Enabled = False 'Stops the timer RefreshList() GetMD5String() Timer1.Enabled = True End Sub
Under the GetMD5String() it's giving me error:
What am I doing wrong?BC30455 Visual Basic AND VB.NET Argument not specified for parameter 'strFileName' of 'Private Function GetMD5String(ByVal strFilename As String) As String'.




Reply With Quote
