Hi Everyone.
I'm trying to create a safe web browser for kids in C#, and I need to
disable the banner ads. Or atleast block them so that nothing happens
when they're clicked on. Please help.
Thanks.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
BryanPosted Sep 16, 2009, 5:10 AM
BryanPosted Sep 15, 2009, 10:29 PM
Kirtan PatelPosted Sep 15, 2009, 10:18 PM
Here i coded That Safe Filter Take a Look It Will Allow Only Google to be Surfed No Other Site it Will Allow
dont Forget to mark "Do you like answer" please it will give me some credits :)
private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e)
{
//Here is Your White List Sites Yo can also Fill this List from Text File by lil Code
List<string> SafeList = new List<string>();
SafeList.Add("google.com");
//Check if it is From safe List if Not Block it !! :P
if (SafeList.Contains(e.Url.Host) == false)
{
webBrowser1.Stop();
MessageBox.Show("Sorry Site Blocked !!!Site is not in White List");
}
}
BryanPosted Sep 15, 2009, 12:26 PM
Kirtan PatelPosted Sep 15, 2009, 12:14 PM
it will be Applied for Internet Explorer as well as Your Browser Control Instance also because both uses same Host File
When you Want to add Add Banner Filter to Your Web Browser Control
edit C:\Windows\System32\Drivers\etc\host
Ie if you want to Block Google
Just Write Line In That Host File using StreamWriter
127.0.0.1 google.com
That Will block Google
you can do same thing for Ad Sites also :)
dont forget to mark "Do you like answer" please if answer helped you it will give me some credits :)
BryanPosted Sep 15, 2009, 12:08 PM
I didn't see the part to disable Banner Ads. Do you think you could point me in a more specific location for it? Thank you.