-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm1.cs
183 lines (151 loc) · 6 KB
/
Form1.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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
using System.Diagnostics;
namespace Windows_Helper
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
KeyPreview = true;
}
string urls = "https://www.youtube.com/watch?v=dQw4w9WgXcQ";
string[] codeS = { "were", "strangers", "never", "give", "known", "down", "desert", "cry", "wanna", "goodbye", "around", "hurt", "each", "around", "gotta", "you" };
public void OpenUrl(string url, Boolean loop)
{
try
{
var psi = new ProcessStartInfo();
psi.UseShellExecute = true;
psi.FileName = url;
switch(loop)
{
case true:
for (int i = 0; i < 5; i++)
{
Process.Start(psi);
}
break;
case false:
Process.Start(psi);
break;
}
}
catch
{
MessageBox.Show("Something went wrong!", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ContinueButton_Click(object sender, EventArgs e)
{
this.TopMost = false;
this.FormBorderStyle = FormBorderStyle.None;
this.WindowState = FormWindowState.Normal;
OpenUrl(urls, true);
this.WindowState = FormWindowState.Maximized;
}
private void button1_Click(object sender, EventArgs e)
{
this.TopMost = false;
this.FormBorderStyle = FormBorderStyle.None;
this.WindowState = FormWindowState.Normal;
OpenUrl(urls, true);
this.WindowState = FormWindowState.Maximized;
}
private void Form1_Load_1(object sender, EventArgs e)
{
this.TopMost = false; // FALSE
this.FormBorderStyle = FormBorderStyle.None;
this.WindowState = FormWindowState.Maximized; // maximized
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
this.WindowState = FormWindowState.Normal;
OpenUrl(urls, true);
Thread.Sleep(1000);
MessageBox.Show("enjoy rickroll my dude");
this.WindowState = FormWindowState.Maximized;
}
private void Form1_KeyUp(object sender, KeyEventArgs e)
{
MessageBox.Show("enjoy rickroll my dude");
this.WindowState = FormWindowState.Normal;
OpenUrl(urls, true);
this.WindowState = FormWindowState.Maximized;
}
private void RulesButton_Click(object sender, EventArgs e)
{
switch(RulesLabel.Visible)
{
case true:
RulesLabel.Visible = false;
break;
case false:
RulesLabel.Visible = true;
break;
}
}
private void RulesLabel_DoubleClick(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show("Hello u have unlocked the secret! U will not get rickrolled :)", "IDK", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
switch(result)
{
case DialogResult.OK:
OpenUrl(urls, true); ;
break;
case DialogResult.Cancel:
Application.Exit();
break;
}
}
private void CodeLabel_DoubleClick(object sender, EventArgs e)
{
if(CodeLabelMenu.Text == "Enter secret code to not get rickrolled.")
{
CodeLabelMenu.Text = "Enter secret code to not get rickrolled. Notes: 1. Code length can be from 4-9 characters. 2. Code is a single word from a song rick astley made. 3. Code can change everytime u enter it.";
} else
{
CodeLabelMenu.Text = "Enter secret code to not get rickrolled.";
}
}
private void CodeTextBox_KeyDown(object sender, KeyEventArgs e)
{
Random random = new Random();
int num = random.Next(0, codeS.Length);
string value = codeS[num];
if (e.KeyCode == Keys.Enter)
{
if(CodeTextBox.Text.ToLower() == value)
{
MessageBox.Show("U have guessed the code! \n Good luck on rickrolling.\n By pressing that button u can leave this app :)", "Just close this box", MessageBoxButtons.OK, MessageBoxIcon.Question);
Application.Exit();
} else
{
OpenUrl(urls, true);
}
}
}
private void toolStripTextBox1_KeyDown(object sender, KeyEventArgs e)
{
Random random = new Random();
int num = random.Next(0, codeS.Length);
string value = codeS[num];
if (e.KeyCode == Keys.Enter)
{
if (CodeTextBoxMenu.Text.ToLower() == value)
{
MessageBox.Show("U have guessed the code! \n Good luck on rickrolling.\n By pressing that button u can leave this app :)", "Just close this box", MessageBoxButtons.OK, MessageBoxIcon.Question);
Application.Exit();
}
else
{
OpenUrl(urls, true);
}
}
}
private void githubToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenUrl("https://github.com/mrredo/rickroll-app", false);
OpenUrl(urls, false);
}
}
}