March 2004
Intermediate to advanced
560 pages
26h 47m
English
using System;
using System.Collections;
namespace Samples
{
public class EnvironmentSample
{
public static void Main()
{
Console.WriteLine("Command line: {0}",
Environment.CommandLine);
Console.WriteLine("CLR Version: {0}",
Environment.Version);
string[] a = Environment.GetCommandLineArgs();
foreach(string s in a)
Console.WriteLine("Command Line Argument: {0}", s);
IDictionary d = Environment.GetEnvironmentVariables();
IDictionaryEnumerator e = d.GetEnumerator();
while(e.MoveNext())
Console.WriteLine("Key: {0} Value: {1}",
e.Key, e.Value);
}
}
}
Command line: Environment CLR Version: 1.0.3705.288 Command Line Argument: Environment Key: SystemDrive Value: C: Key: USERPROFILE Value: C:\Documents and Settings\damien Key: INCLUDE ...
Read now
Unlock full access