CSharp examples for Language Basics:Console
Step through the command-line arguments.
using System;//w w w .jav a 2s . c o m class MainClass { public static void Main(string[] args) { // Step through the command-line arguments. foreach (string s in args) { Console.WriteLine(s); } // Alternatively, access the command-line arguments directly. Console.WriteLine(Environment.CommandLine); foreach (string s in Environment.GetCommandLineArgs()) { Console.WriteLine(s); } } }