hi
How I can reset my C# program ?
I want that my program will start again
in Windows mobile
thank's in advance
hi
How I can reset my C# program ?
I want that my program will start again
in Windows mobile
thank's in advance
There is the Application.Restart method, but it doesn't look like it's supported on the Compact Framework. You could try:
Application.Exit();
Application.Run(new MyForm());
Run:
ProcessStartInfo s = new ProcessStartInfo();
s.FileName = Assembly.GetExecutingAssembly().GetName().CodeBase;
s.UseShellExecute = false;
Process.Start(s);
And:
Application.Exit();
One way is to P/Invoke (or use an existing wrapper) around the CeRunAppAtTime API, schedule your app to launch in a couple of seconds time, and exit. The SDF (www.opennetcf.org/sdf/) has a wrapper for this API.
Peter
-- Peter Foot Device Application Development MVP www.peterfoot.net | www.inthehand.com
From The Internet Archive ( http://web.archive.org/web/20071231144636/http://www.themssforum.com/Compact/application-restart/ ). (I gave up on figuring out why the url parser hates that link)
See CeRunAppAtTime on MSDN.
Unlike Zanoni's solution, this will not have two instances of your application running at the same time. It's much uglier, though.