0

How to do to change the router ip address, after selecting the option and save with button.
wants to do a small program that I can quickly and easily change the 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
            {

            }
        }
    }
}
  • Has been answered several times, look her for example [link](https://stackoverflow.com/questions/1469764/run-command-prompt-commands) – C. Gonzalez Sep 10 '17 at 18:29

1 Answers1

1

So start a process via code you can use

System.Diagnostics.Process.Start()

For example: System.Diagnostics.Process.Start("ipconfig", @"/all");

The command will be executed and the command line will be closed, but I admit that I don't know, how to let the command window stays open.

Martin Backasch
  • 1,829
  • 3
  • 20
  • 30