#include #include #include int main() { char site[20],c,d; ifstream in; ofstream out; cout<<"press 1 to block website & press 2 to open website"; cin>>d; switch(d) { case 1: { 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; 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.replace(out.find(site),site.length()," "); out.close(); return 0; } case default: cout<<"wrong choice dude run exe again"; }return 0; }