How to Save Your Computer Start-up History in C#

Step 1: Create a simple console application as follows:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.IO;

namespace autologin

{

    class Program

    {

        static void Main(string[] args)

        {

            File.AppendAllText(@"C:\logintime.txt", Environment.NewLine);

            File.AppendAllText(@"C:\logintime.txt", "Your Login Time is : " + DateTime.Now.ToString());

        }

    }

}

Step 2: Build your application and get exe file.

Step 3: Goto control pannel->Sheduled task->Add sheduled Task->Next>Browse

Step 4: Browse your exe file that will created after apllication build

Step 5: Set option when my computer start and finish wizard

Now when your computer will started ,it will feed date and time in C:\logintime.txt file which maintain your computer start-up history.
Small applications can be used for big tasks.
 

Ebook Download
View all
Learn
View all