Click here to Skip to main content
15,889,034 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello ! I am creating an application in C#, in which my app gets some data from the user. I store these data in a List. Now my program is processing this items for quite some time ... and i want the option the user to close it's computer, and then resume the hole procedure later ... without the need to re-enter the data and start from the beginning. Is there a way to do that ?

What I have tried:

I thought of serializing the list but that didn't worked out very well.
Posted
Updated 1-Aug-17 9:30am
Comments
RickZeeland 30-Jul-17 14:36pm    
If you make it a Windows service with start set to 'automatic' it will start automatically on restart of the computer. But WPF will not work with a service, so you would need a service that communicates with the front end in WPF, quite complicated stuff !
xXxRevolutionxXx 30-Jul-17 17:43pm    
Yep i know. I don't wont to mess up with windows services though. I have something else in my mind about that ... as long as i find a way to save the progress of my app.

Quote:
How do I continue an operation after computer restarts

First you need to make your program start automatically restart with windows.
[^]

You also need to save the user input and reload on program stating.
Quote:
Now my program is processing this items for quite some time

Either the processing restart from beginning every time, either you need to save the state on a regular basis.
The state must be done at a known point so that it can be reloaded an processing restarted.
 
Share this answer
 
Intercept shutdown, persist state, resume from that persisted state. So what would be in that persisted state? What do you need to know in order to resume?
 
Share this answer
 
Comments
xXxRevolutionxXx 30-Jul-17 18:11pm    
I want to persist some variables including a list of strings(as i said in my original post). The only requirement for the job to finish is the computer to be ON :P
See this tip on how to automatically start a WinForms application: Run C# application on user logon (Windows Forms)[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900