Reputation: 18305
I need to restart a windows mobile 6 application.
Here is the code I have tried but it just exits and does not restart the app.
public static void RestartApplication()
{
var fileName = Assembly.GetExecutingAssembly().GetName().CodeBase;
var startInfo = new ProcessStartInfo
{
FileName = fileName,
};
Process.Start(startInfo);
Application.Exit();
}
Thanks!
Upvotes: 2
Views: 2563
Reputation: 191
I tried this code work like a charm on Windows CE 6.
this.Close();
Process.Start(Assembly.GetExecutingAssembly().GetName().CodeBase, "");
It's hard to find a simple way to restart the application on Windows CE on the internet, so I post what I found. I hope this could help somebody to save time.
Upvotes: 0
Reputation: 5315
You can schedule the OS to run the application in say 10 secs.
CeRunAppAtTime
http://www.rhinomobile.net/2007/03/run-application-at-time-and-time-change.html
http://windows-tech.info/10/d99ab8a56d1f4818.php
Upvotes: 2