How can I execute Application.Restart () on Windows Mobile 6?
I need to restart my Windows Mobile 6 application.
Here is the code I tried, but it just exits and doesn't restart the app.
public static void RestartApplication()
{
var fileName = Assembly.GetExecutingAssembly().GetName().CodeBase;
var startInfo = new ProcessStartInfo
{
FileName = fileName,
};
Process.Start(startInfo);
Application.Exit();
}
Thank!
+2
source to share
2 answers
You can schedule the OS to start in 10 seconds.
CeRunAppAtTime
http://www.rhinomobile.net/2007/03/run-application-at-time-and-time-change.html
+2
source to share
I tried this code to work like a charm on Windows CE 6.
this.Close();
Process.Start(Assembly.GetExecutingAssembly().GetName().CodeBase, "");
It's hard to find an easy way to restart an application in Windows CE on the internet, so I post what I found. I hope this can help someone save some time.
0
source to share