Thread: Easiest way to cut off net access?

  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    29

    Easiest way to cut off net access?

    Okay my parents asked me if it would be possible to write a program that can limit the time frame during which the internet can be accessed from my sisters computers. I haven't done any type of real network programming in C++ (some in Java) and figured this would be a good project to get a little bit ahead of my classes and to not forget everything I learned over the summer. The problem is, as far as actually blocking the internet I don't know where to begin at all. I can make the interface and set it up for my parents to access the settings and change what times they can use the net but I don't know how to actually cut it off. I'm sure there are many ways I was just looking for any easy suggestions.
    Thanks

  2. #2
    Amazingly beautiful user.
    Join Date
    Jul 2005
    Location
    If you knew I'd have to kill you
    Posts
    254
    Heres an easy way. Just run the command line programs below however you want (system("COMMAND") comes to mind).

    This won't stop anyone who knows much about Windows from using the internet, but should stop anyone somewhat computer illiterate.

    Simply run the command
    Code:
    ipconfig /release_all
    to release all the network connections (disable the internet).

    Code:
    ipconfig /renew_all
    to enable/reactivate all the network connections.

    Thats the easiest way I can think of off the top of my head.

    Thus,
    Code:
    system("ipconfig /release_all");
    should disable it, etc.

  3. #3
    Registered User
    Join Date
    May 2005
    Posts
    41
    Also, there is another command for Windows XP to stop network connections, the code is as follows:
    Code:
    system("NET STOP NETWORK CONNECTIONS");
    You usualy have a pair of quotes surrounding Network connections, but of course, it wont work here.

    Which means that the command probaly wont work either, however, you could to it this way:

    Code:
    system("start net.bat");
    And then save the following code as net.bat in the programs folder, via Notepad:
    Code:
    @echo off
    net stop "network connections"
    exit
    And then to start it back up, create a another batch file using net start instead of net stop, or use variables.

    Of course, Crazy Norman's way is more efficient, and easier.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. accessing a database made in Access..
    By willc0de4food in forum Windows Programming
    Replies: 4
    Last Post: 10-10-2005, 07:40 PM
  2. FtpFileFind access violation with MS VC++ 6.0
    By earth_angel in forum C++ Programming
    Replies: 3
    Last Post: 09-22-2005, 07:02 PM
  3. Office access in C/C++ NOT VC++!! :)
    By skawky in forum C++ Programming
    Replies: 1
    Last Post: 05-26-2005, 01:43 PM
  4. 0xC0000005: Access Violation
    By Strider in forum Windows Programming
    Replies: 3
    Last Post: 11-07-2001, 02:46 PM
  5. How to access Network Card using C
    By vadiv in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 10-17-2001, 01:47 AM