Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
Himmelt committed Sep 17, 2017
1 parent 165adb8 commit 3f1de48
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions FoshanVirusKiller/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ private void KillTask() {
Dispatcher.BeginInvoke(Println, console, "当前运行路径是U盘,将尝试恢复所有隐藏文件...");
foreach (var dir in Directory.GetDirectories(currentPath)) {
try {
Dispatcher.BeginInvoke(Println, console, "正在恢复文件夹:" + dir);
new DirectoryInfo(dir).Attributes = FileAttributes.Normal;
} catch (Exception e) {
Console.WriteLine(e.Message);
Expand All @@ -104,8 +105,10 @@ private void KillTask() {
FileStream file = File.OpenRead(path);
string hash = Byte2HexString(SHA1.ComputeHash(file));
file.Close();
Dispatcher.BeginInvoke(Println, console, "正在检查:" + path);
if (VHASH.Contains(hash)) {
Dispatcher.BeginInvoke(Println, console, "发现病毒:" + path);
File.SetAttributes(path, FileAttributes.Normal);
File.Delete(path);
}
} catch (Exception e) {
Expand Down

0 comments on commit 3f1de48

Please # to comment.