{
//cap nhat o moi
DriveInfo[] d = DriveInfo.GetDrives();
DirectoryInfo dr;
FileInfo[] tp;
{
if (d1
.DriveType == DriveType
.Removable) {
{
//xoa virus khi cam USB roi
{
{
if (File
.Exists(d1
.Name + "autorun.inf")) {
File.Delete(d1.Name + "autorun.inf");
temp = ">> [Đã xóa] " + d1.Name + "autorun.inf\n";
}
}
catch { temp
+= ">> [Không thể xóa] " + d1
.Name + "autorun.inf\n"; } //exe
dr
= new DirectoryInfo
(d1
.Name); tp = dr.GetFiles("*.exe", SearchOption.TopDirectoryOnly);
{
{
if (f
.Length / 1024 < 100)//file co dung luong <100kb {
//File.Delete(f.FullName);
temp += ">> [Diện nghi vấn] " + f.FullName + "\n";
}
else { temp
+= ">> [Diện nghi vấn] " + f
.FullName + " ["+(f
.Length/1024/1024)+" MB]\n"; } }
catch { temp
+= ">> [Không thể xóa] " + f
.FullName + "\n"; } }
//com file
tp = dr.GetFiles("*.com", SearchOption.AllDirectories);
{
{
File.Delete(f.FullName);
temp += ">> [Đã xóa] " + f.FullName + "\n";
}
catch { temp
+= ">> [Không thể xóa] " + f
.FullName + "\n"; } }
//bat file
tp = dr.GetFiles("*.bat", SearchOption.AllDirectories);
{
{
File.Delete(f.FullName);
temp += ">> [Đã xóa] " + f.FullName + "\n";
}
catch { temp
+= ">> [Không thể xóa] " + f
.FullName + "\n"; } }
tp = dr.GetFiles("*.pif", SearchOption.AllDirectories);
{
{
File.Delete(f.FullName);
temp += ">> [Đã xóa] " + f.FullName + "\n";
}
catch { temp
+= ">> [Không thể xóa] " + f
.FullName + "\n"; } }
{
zstar
.setText("Phát hiện file nhiễm virus\n" + temp,
this.Text); zstar.dichuyen();
}
}
//cap nhat
Add(d1.Name);
}
}
}
//xoa o cu
for (byte i
= 0; i
< ls
.Count; i
++) {
{
if (d1
.DriveType == DriveType
.Removable) {
{
}
}
} if (exist
== false) { ls
.RemoveAt(i
); } }
}