Logo 
Search:

C# FAQ

Submit Interview FAQ
Home » Interview FAQ » C#RSS Feeds

How can I process command-line arguments?

  Shared By: Agatha Miller    Date: Sep 24    Category: C#    Views: 1195

Answer:

Like this:

using System;

class CApp
{
public static void Main( string[] args )
{
Console.WriteLine( "You passed the following arguments:" );
foreach( string arg in args )
Console.WriteLine( arg );
}
}
(Take a look at Charles Cook's NOptFunc project for easy command-line parsing.)

Share: 
 

Didn't find what you were looking for? Find more on How can I process command-line arguments? Or get search suggestion and latest updates.


Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: