How to restart program

  • Thread starter Thread starter A.Popov
  • Start date Start date
A

A.Popov

Hi,

Whats the best way a program to restart itself, and how this to be done
in C#.
I need my program to be restarted after some events.

Thanks
 
A.Popov said:
Hi,

Whats the best way a program to restart itself, and how this to be done
in C#.
I need my program to be restarted after some events.

When you need your program to be restarted, start a new instance of your
program and immediately close the current instance.
Application.ExecutablePath contains, i think, the path of your executable so
to start a new instance of your program, you can do:
Process.Start(Application.ExecutablePath). - warning: not tested -
 
Thanks a lot for the idea!
When you need your program to be restarted, start a new instance of your
program and immediately close the current instance.
Application.ExecutablePath contains, i think, the path of your executable so
to start a new instance of your program, you can do:
Process.Start(Application.ExecutablePath). - warning: not tested -
 
Back
Top