Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command Line Argument

Status
Not open for further replies.

gunalan

Technical User
Jun 29, 2004
52
US
Hi,

I am new C#.I am trying to compile the program from Microsoft Visual C#.Net tool.The trouble is that how to give command line input through this tool.I am trying hard to figure out.

say i have given small program....

// Namespace Declaration
using System;

// Program start class
class NamedWelcome
{
// Main begins program execution.
public static void Main(string[] args)
{
// Write to console
Console.WriteLine("Hello, {0}!", args[0]);
Console.WriteLine("Welcome to the C# Station Tutorial!");
}
}


I am having trouble giving command line input to this program...

thank you.
 
Your code works fine. I compiled it and ran it from the prompt. If your are using VS.NET you might want to right click on the project that you code is in and make sure the output type is a Console Application.


C:\marty\CSharp>NamedWelcome Lisa
Hello, Lisa!
Welcome to the C# Station Tutorial!

Marty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top