Click here to Skip to main content
15,881,559 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
I need block all websites and after unblock some pages
in c#
Posted
Updated 18-Nov-12 11:57am
v2
Comments
Sergey Alexandrovich Kryukov 18-Nov-12 18:07pm    
It depends on the level you want to block them. Any why?
--SA

add the url that you want to block in HOST file whicho you can fine in C:\Windows\System32\Drivers\etc

e.g


127.0.0.1 youtube.com
127.0.0.1 www.youtube.com

in order to make change you will have to run notepad.exe as admin then open the file in the notepad then do the alteration.
 
Share this answer
 
v2
Comments
Richard MacCutchan 2-Dec-14 7:16am    
Please do not post to questions that are more than two years old.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900