I have a simple c# console application that is scheduled after every 5 mins. Every invocation of the program requires the output of the last run.
What I am doing right now is using a text file and store the result in it. next time when it runs it opens the text file and know the output of the previous run.
Is there any other way to do it that wont require any such text file ?
Like maintaining a session variable etc ?
First use mutex lock solution to force app to run only one instance at same time.
then create a serializable class to hold the app state and a helper class to load and save it to a file.see example:
then load and save the state from your app: