static int Main(string[] args)
{
…
string[] the Args=Environment.GetCommandLineArgs();
foreach(string arg in theArgs)
Console.WriteLIne("Arg:{0}",arg);
Console.ReadLine();
return -1;
}
static void ShowEnvironmentDetails()
{
foreach (string drive in Environment.GetLogicalDrives())
Console.WriteLine("Drive:{0}",drive);
Console.WriteLine("OS:{0}",Environment.OSVersion);
Console.WriteLine("Number of processors:{0}",Environment.ProcessorCount);
Console.WriteLine(".NET Version: {0}",Environment.Version);
}
static void ChangeConsoleColor()
{
ConsoleColor prevColor = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Red;
ShowEnvironmentDetails();
Console.ForegroundColor = prevColor;
Console.WriteLine("{1},{0},{2}",10,20,30);
}
static void FormatNumericalData()
{
Console.WriteLine("The value 9999 in various formats:");
Console.WriteLine("c format:{0:c}",9999);
Console.WriteLine("d9 format:{0:d9}", 9999);
Console.WriteLine("f3 format:{0:f3}", 9999);
Console.WriteLine("n format:{0:n}", 9999);
Console.WriteLine("E format:{0:E}", 9999);
Console.WriteLine("e format:{0:e}", 9999);
Console.WriteLine("X format:{0:X}", 9999);
Console.WriteLine("x format:{0:x}", 9999);
}