Click here to Skip to main content
15,878,543 members
Please Sign up or sign in to vote.
4.60/5 (2 votes)
See more:
Hello I want to make an application to respond to Command Prompt.So for the user it will look like this:
Microsoft Windows [Version 6.0.6001]
Copyright (c) 2006 Microsoft Corporation.  All rights reserved.

c:\>myapp.exe -arg1
Hello you chose the first option.


How do I make my app respond with "Hello you chose the first option"?
Posted
Updated 15-Nov-10 8:30am
v2

1 solution

if ((args.Length > 0) && (args[0] == "-arg1"))
{
    Console.WriteLine("Hello you chose the first option");
}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900