Connect and disconnect the Internet?

4

I would like to do two basic .exe, one would be to disconnect the Internet and open one program and the other would be to just connect to the Internet.

The part of opening the program I know, now disconnect and connect the Internet in c ++ I have not yet learned. I know I could do with .bat, but in fact I know how to do it in .bat, but I wanted to know in C ++ too.

In .bat the disconnect and open would look like this:

@echo off
netsh interface set interface "" DISABLED
cd diretorio
programa.exe

.bat to simply connect:

@echo off
netsh interface set interface "" ENABLED
    
asked by anonymous 27.11.2014 / 22:03

1 answer

7
  

Note: The question was edited and passed the tag of

28.11.2014 / 00:25