Hi,I'm trying to do a parental control software project in C#. I made blocking and unblocking specific websites by using hosts file but the other part of my project is blocking the internet access. When I click a button, the internet access will be blocked and when another button is clicked the internet will be reachable. Block/enable internet access in C#, how can it be done? Thank you for your help.

Re: Blocking internet access in C# 80 80

One way is to disable/enable the network adapter(s). Here's a few posts to look at that should give you some idea: Click Here, Click Here Click Here

Re: Blocking internet access in C# 80 80

I'm not sure this is possible...imagine the problems that could be caused if this was possible...

As tinstaafl said, you can disable (or enable) an adapter using WMI (specifically the MSFT_NetAdapter class).

Click Here

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.