简体   繁体   中英

How to relaunch running application

i am working on an win mobile application . I am running application in background using

e.Cancle = true;

Now i need to relaunch same instance of that application so that i can off that application .

can any one tell me ... how to do this?

If the application needs to restart itself this may help you :

http://msdn.microsoft.com/en-us/library/system.windows.forms.application.restart.aspx

You don't actually need to be running a winforms application for this to work - you just need to make sure the System.Windows.Forms DLL is present.

PS. i couldn't get this working for WPF - but I don't actually remember the exact reason right now

This might do it.

System.Diagnostics.Process.Start(Application.ExecutablePath);
Close();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM