E
eduardorp1
I have a GUI application that needs to be invoked from the command line
as well. It should work both as a GUI and as a console application.
When I invoke it from the command line, it reads all the command line
options perfectly. However, I can't use Console.WriteLine to write
messages to the console (the lines don't appear at the console window).
Is it possible? What should I do to "connect" the console?
My Main() is:
static void Main(string[] args)
{
if (args.Length == 0)
{
Application.Run(new WorkspaceForm());
return;
}
if (args.Length == 2 && args[0].ToLower() == "-mycommand")
{
DoMyCommand(args[1]);
return;
}
Console.WriteLine("Usage:\n\napplication_name -mycommand
<file>\n");
Console.WriteLine(" Performs mycommand on file.\n");
}
Thanks
Eduardo
as well. It should work both as a GUI and as a console application.
When I invoke it from the command line, it reads all the command line
options perfectly. However, I can't use Console.WriteLine to write
messages to the console (the lines don't appear at the console window).
Is it possible? What should I do to "connect" the console?
My Main() is:
static void Main(string[] args)
{
if (args.Length == 0)
{
Application.Run(new WorkspaceForm());
return;
}
if (args.Length == 2 && args[0].ToLower() == "-mycommand")
{
DoMyCommand(args[1]);
return;
}
Console.WriteLine("Usage:\n\napplication_name -mycommand
<file>\n");
Console.WriteLine(" Performs mycommand on file.\n");
}
Thanks
Eduardo