Dear support team,
How to Connect/Disconnect Internet through c# code? . In Command Prompt, we use 'ipconfig/release' for disconnect and 'ipconfig/renew' for connect. urgent help needed.
Regards,
Amiruddin
How to Connect/Disconnect Internet through c# code
-
- Posts: 30
- Joined: Mon Jan 21, 2013 1:31 pm
Re: How to Connect/Disconnect Internet through c# code
This is a general C# question that you should be able to find by doing a quick Google search...
Something like this should work. I just typed it up real quick so there might be a bug but it should get you going...
Something like this should work. I just typed it up real quick so there might be a bug but it should get you going...
Code: Select all
ProcessStartInfo pInfo = new ProcessStartInfo();
pInfo.FileName = @"C:\WINDOWS\System32\ipconfig.exe";
pInfo.Arguments = "/release";
Process p = Process.Start(pInfo);
p.WaitForExit();
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!
Ciege...
Ciege...
-
- Posts: 30
- Joined: Mon Jan 21, 2013 1:31 pm
Re: How to Connect/Disconnect Internet through c# code
Hai Ciege,
The code you sent is working perfectly.
Thanks
Amiruddin
The code you sent is working perfectly.
Thanks
Amiruddin