C# Environment CommandLine

Description

Environment CommandLine gets the command line for this process.

Syntax

Environment.CommandLine has the following syntax.


public static string CommandLine { get; }

Example

The following example displays its own command line. Invoke this sample with an arbitrary set of command line arguments.


using System;/*from   w  w w . j  a v  a 2 s  .  c o  m*/

class Sample 
{
    public static void Main() 
    {
        
        Console.WriteLine("CommandLine: {0}", Environment.CommandLine);
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version