Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private List<string> BlockList = new List<string>() { "http://www.google.com", "http://www.google.co.uk", "http://www.bing.com" };
- private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e)
- {
- string[] BlockArray = BlockList.ToArray();
- for (int i = 0; i < BlockArray.Length; i++)
- {
- if (e.Url.Equals(BlockList[i]))
- {
- e.Cancel = true;
- MessageBox.Show("Booyaa Says No!", "NO NO NO", MessageBoxButtons.OK, MessageBoxIcon.Hand); // Block List Error Message
- }
- private void button6_Click_1(object sender, EventArgs e)
- {
- string url = textBox2.Text;
- // Get if the user entered the right password
- GetPass pass = new GetPass(password);
- // Check this with a dialog result
- DialogResult result = pass.ShowDialog();
- if (result == DialogResult.OK)
- {
- BlockList.Add(url);
- MessageBox.Show("Added " + url + " to blocklist.");
- textBox2.Clear();
- }
- else
- {
- MessageBox.Show("Booyaa Says Wrong Password", "Wrong Password", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- }
- }
- private void button7_Click_1(object sender, EventArgs e)
- {
- string url = textBox2.Text;
- // Get if the user entered the right password
- GetPass pass = new GetPass(password);
- // Check this with a dialog result
- DialogResult result = pass.ShowDialog();
- if (result == DialogResult.OK)
- {
- BlockList.Remove(url);
- MessageBox.Show("Removed " + url + " from blocklist.");
- textBox2.Clear();
- }
- else
- {
- MessageBox.Show("Booyaa Says Wrong Password", "Wrong Password", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement