Page 1 of 2
WebSite Blocker
Posted: Mon Feb 22, 2010 3:51 pm
by Martin
How to make an WebSite Blocker?

Re: WebSite Blocker
Posted: Mon Feb 22, 2010 4:14 pm
by Insignia
How do you mean, Website blocker?
Re: WebSite Blocker
Posted: Mon Feb 22, 2010 4:16 pm
by Martin
i dont want the webbrowser control to navigate to a some sites that are listed in a listbox control
Re: WebSite Blocker
Posted: Mon Feb 22, 2010 9:37 pm
by Lewis
Hello this is not my code,
On form load put this code:
LoadBlockedSites()
The sub to load the blocked sites in a listbox:
Private Sub LoadBlockedSites()
ListBox1.Items.Clear()
Dim s As String
For Each s In My.Settings.BlockedSites
ListBox1.Items.Add(s)
Next
The code to Add a blocked site:
If txtBlock.Text = "" Then
'Do nothing
Else
My.Settings.BlockedSites.Add(AppManager.FixURL(txtBlock.Text))
LoadBlockedSites()
txtBlock.Text = String.Empty
End If
Also make a setting with the Name: BlockedSites
The type as: System.Collections.Specialized.StringCollection
Scope as: User
Value as:
<?xml version="1.0" encoding="utf-16"?>
<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<string>www.codenstuff.com</string>
</ArrayOfString>
;o CodeNStuff blocked?
I think thats it if you get errors, you might, Then contact me 
THIS CODE DOES NOT WORK :(
Re: WebSite Blocker
Posted: Mon Feb 22, 2010 10:14 pm
by Nery
Just do something to check if the URL fits one of the sites in a ListBox, like if the URL contains
www.codenstuff.com then it wont let you navigate to it by navigating to a kind of "error" web page made by you or other site.
Re: WebSite Blocker
Posted: Tue Feb 23, 2010 5:03 pm
by Martin
lewisfroom wrote:Hello this is not my code,
On form load put this code:
LoadBlockedSites()
The sub to load the blocked sites in a listbox:
Private Sub LoadBlockedSites()
ListBox1.Items.Clear()
Dim s As String
For Each s In My.Settings.BlockedSites
ListBox1.Items.Add(s)
Next
The code to Add a blocked site:
If txtBlock.Text = "" Then
'Do nothing
Else
My.Settings.BlockedSites.Add(AppManager.FixURL(txtBlock.Text))
LoadBlockedSites()
txtBlock.Text = String.Empty
End If
Also make a setting with the Name: BlockedSites
The type as: System.Collections.Specialized.StringCollection
Scope as: User
Value as:
<?xml version="1.0" encoding="utf-16"?>
<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<string>www.codenstuff.com</string>
</ArrayOfString>
;o CodeNStuff blocked?
I think thats it if you get errors, you might, Then contact me 
THIS CODE DOES NOT WORK :(
The Code Does Not Work :(
Re: WebSite Blocker
Posted: Thu Mar 11, 2010 5:36 am
by Livengood
You could do somthing link
Code: Select allIf textbox1.text = "" then
webbrowser1.navigate("")
end if
you can edit this to make it were is will read the text in a listbox
Re: WebSite Blocker
Posted: Thu Mar 11, 2010 9:07 pm
by 35000vr
How about website un-blocker?
Re: WebSite Blocker
Posted: Sat Mar 13, 2010 8:54 am
by NoWayIn
Here's a example :
Let's say you want to block out all website except for CodenStuff's website
do the following :
If Textbox1.Text.contains("codenstuff") Then
WebBrowser1.Navigate(Textbox1.Text)
Else
Msgbox("Only CodenStuff Links Will Work")
End If
Re: WebSite Blocker
Posted: Sat Mar 13, 2010 9:22 pm
by Livengood
hello Martin64

,
i have been working on a project for this for you. i will post the files on heres as soon as i can, my father has my computer so i am not able to do this now.... :(
----------------------------------------------------------------------------------------------------------------------------------------

i added it