Take a look at Routing and Remote Access Service APIs in the Platform SDK. You will have to PInvoke functions to build a firewall of sorts (that filters packets).
You also can check the following code:
String path = @"C:\Windows\System32\drivers\etc\hosts";
StreamWriter sw = new StreamWriter(path, true);
String sitetoblock = "\n 127.0.0.1 google.com";
sw.Write(sitetoblock);
sw.Close();
Regards,
Niradhip(James Hetfield)
MCP,MVC,MVP(Mindcracker)
--------------------------------------------------------------------------------------
Please remember to click “Do you like this answer” on the post that helps you.