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 -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top