我正在尝试编写一个反病毒扫描程序&可以让单个文件扫描工作,但我的“完整系统扫描”无法正常工作。这是代码(对于一个要扫描的位置):
Dim hash_type As String
Dim file_name As String
Dim array() As Byte
Dim dir As New DirectoryInfo(Environment.SpecialFolder.ProgramFiles)
For Each foundFile As FileInfo In dir.GetFiles("*.exe", SearchOption.AllDirectories)
ScanLocation.Items.Add(dir)
Dim path As String = foundFile.ToString
txtFilePath.Text = path
Dim sample As String
sample = md5_hash(path)
Dim File As System.IO.StreamReader = System.IO.File.OpenText("C:\Program Files\MalwareBlocker\Signatures.txt")
Dim File1 As String = File.ReadToEnd()
File.Close()
If File1.Contains(sample) Then
InfectedFiles.Items.Add(sample)
Else
'IGNORE
End If
Next foundFile
我希望扫描程序在“Program Files”,“Roaming”等目录中转换每个.exe文件。 “温度”&然后检查每个.exe文件MD5到签名的文本文件。