How to reset my program in C # (Windows mobile)?

How can I reset my program in C #?

I want my program to start again

on windows mobile

Thanks in advance

+3
source share
3 answers

One way is to P / Invoke (or use an existing wrapper) around the CeRunAppAtTime API, plan your application to launch in a couple of seconds, and exit. SDF (www.opennetcf.org/sdf/) has a wrapper for this API.

Peter

- Application Development for MVP Pagers www.peterfoot.net | www.inthehand.com

- (http://web.archive.org/web/20071231144636/http://www.themssforum.com/Compact/application-restart/). ( , URL- )

CeRunAppAtTime MSDN.

Zanoni, . , .

+1

Run:

ProcessStartInfo s = new ProcessStartInfo();
s.FileName = Assembly.GetExecutingAssembly().GetName().CodeBase;
s.UseShellExecute = false;
Process.Start(s);

Application.Exit();
0

There is an Application.Restart method , but it does not look like Compact Framework support. You may try:

Application.Exit();
Application.Run(new MyForm());
-1
source

Source: https://habr.com/ru/post/1711197/


All Articles