1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
static void Main(params string[] args)
{
if (args.Length == 0)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
else
{
if (args.Length == 2)
{
DateTime d1;
DateTime d2;
if (DateTime.TryParse(args[0], out d1) && DateTime.TryParse(args[1], out d2))
{
// Tu fais ton traitement sur des deux dates ici
return;
}
}
Console.WriteLine("Si vous voulez lancer le programme en mode console, il faut deux arguments au format date.");
}
} |
Partager