private void webpage_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
  {
    SqlCommand cmd = new SqlCommand("SELECT * FROM [blacklist] WHERE BlackListed_Sites = '"+    webpages + "'", cs);
            cs.Open();
            cmd.Connection = cs;
            SqlDataReader reader = null;

            reader = cmd.ExecuteReader();
            if (reader.Read())
            {

                CheckState.Checked.ToString();
                MessageBox.Show("Blocked");

            }

            else
            {


                string url = ComboAddress.Text;
                if (url == "")
                    return;


                WebBrowser thispage = GetCurrentWebBrowser();
                thispage.Navigate(url);
                timer1.Enabled = true;
                lblpageinfo.Text = thispage.StatusText.ToString();

                ComboAddress.Items.Add(url);

            }


            cs.Close();


            UpdateAllNames();
            UpdateBackForwardButtons();
            timer1.Enabled = false;

            pictureBox_busy.Image = Smart_Browser.Properties.Resources._4;


        }

this code for blocking the site. It works only when i type any website on the combo address but when i type site name in google search engine or any other search engine the site is to be shown. so i want site should be block and not open even if the site name written in any search engine as well as combo address.

Edited 5 Years Ago by ~s.o.s~: added code tags, please learn to use them

This article has been dead for over six months. Start a new discussion instead.