You must Sign In to post a response.
  • Category: .NET

    Possible to store data in a console Application run as a scheduled tasks?


    I have implemented a console application that sends a mail based on the data returned from a web service. I have configured it as a windows task scheduler that runs every 5 mints.

    Here I am retrieving a list of employee status using the service. Employee status can be Active, Inactive and few others too. I have to send a notification mail to the employee email id whenever the following status change occurs, "Active-> Inactive" and "Inactive->Active". So in short this requires me to store the previous status.

    Is there any way to store the previous data. I tried using static variable. But I believe since the application is run each 5 mints, it starts as a new application. Kindly advice.

    I have just a simple main function and SendMail() only.

  • #769526
    Hi Divya,

    You have to keep store the previous information in a text file or you can store the information as an object and serialize within your application folder.

    Based on this, you can get the previously stored value. Also, you can keep as an XML file that's better to manipulate.

    Let me know if you have any questions.

    V.M. Damodharan
    "Your talent will be worthless, when you have fear and tension."

  • Sign In to post your comments