Pages

Thursday, June 21, 2012

How to block a website from your pc




i am here to post how to block any website in your pc to block from ilegal acess
it is quite easy to use.
Follow the steps ...


Step1-open any cpp compiler

Step2- paste the following code into compiler
       #include <fstream>
 #include <iostream>

 using namespace std;

 int main()
 {
 char site[20],ch;
 ifstream in;
 ofstream out;

 cout<<"Enter the Name of the Site to Block \n";
 cin>>site;

 out.open("C:/Windows/System32/​drivers/etc/hosts",ios::app);
 if(!out)
 cout<<"Either File Not Found or Permission Denied, Run as Admin the EXE of the Program";
 else
 {
 out<<"127.0.0.1"<<"\t"<<site;
 cout<<site;
 cout<<"is blocked";
 }
 out.close();
 return 0;
 }
step 3: save it as .cpp

step4-compile it and run it

step 5-rum the .exe file as administrator
done......

No comments:

Post a Comment