ReStart Console App.

Console application


I add this exe in startup folder, so when Windows restart the console open and show a message.
C:\Users\pedro.falcao\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
After when a keyboard button is push the Windows Form1 is open.



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Opcoes_Arranque
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Write("Wait, this is a startup app just to test my skills. Master Guru Falcão");
            Console.ReadLine();

            Form1 form1 = new Form1();
            form1.ShowDialog();

            /*
            DialogResult result = MessageBox.Show("Do you want to save changes?", "Confirmation", MessageBoxButtons.YesNoCancel);
            if (result == DialogResult.Yes)
            {
                //...
            }
            else if (result == DialogResult.No)
            {
                //...
            }
            else
            {
                //...
            }
            */
        }
    }
}

Comentários

Mensagens populares