c# - wpf - How to change IP address? -
this question has answer here:
- run command prompt commands 8 answers
how change router ip address, after selecting option , save button.
wants small program can , change router's ip address.
namespace wpfapplication1 { public partial class mainwindow : window { public mainwindow() { initializecomponent(); } private void radiobutton_checked(object sender, routedeventargs e) { } private void button_click(object sender, routedeventargs e) { if (checkbox1.ischecked == true) { netsh interface ip set address "ethernet" static 192.168.1.8 255.255.255.0 192.168.1.1 1 } else if (checkbox2.ischecked == true) { netsh interface ip set address "ethernet" static 192.168.1.8 255.255.255.0 192.168.1.3 1 } else { } } } }
so start process via code can use
system.diagnostics.process.start()
for example: system.diagnostics.process.start("ipconfig", @"/all");
the command executed , command line closed, admit don't know, how let command window stays open.
Comments
Post a Comment