Last active
May 17, 2020 17:18
-
-
Save FurkanKozen/e4be76f71d92b1d6fb5f5a83a5376aaf to your computer and use it in GitHub Desktop.
Using command-line arguments in a console application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
foreach (var arg in args) | |
{ | |
Console.WriteLine(arg); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run the EXE file of this program from the command line like:
[Dir]>./CommandLineArgs.exe test-arg-1 test-arg-2
[Dir]
is the directory where the executable file is.The program writes: