private void btnBlock_Click(object sender, EventArgs e) { String path = @"C:\Windows\System32\drivers\etc\hosts"; StreamWriter sw = new StreamWriter(path, true); String sitetoblock = "\n 127.0.0.0 www.facebook.com"; sw.Write(sitetoblock); sw.Close(); MessageBox.Show("Site Blocked"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)