The main purpose of "Dot Net Labs" provide the dot net program. You can learn dot net, .Net Core, C#, SQL, Linq step-by-step.

Saturday 30 May 2015

Command Line Arguments Demo : Enter the Arguments on execution time


Step 1: Enter the below program in “Notepad”

using System;
class CommandLineDemo
{
static void Main(string []args)
{
Console.WriteLine("Welcome to CommandLine Arguments Demo");
Console.WriteLine("First argument is :"+ args[0]);
Console.WriteLine("Second argument is :"+ args[1]);
Console.ReadLine();
}
}

Step 2 : Save with extention “ <file_name>.cs”

Step 3 : Open Visual Studio Command Prompt


Step 4 : Open command prompt as below




Step 5 : Enter the file location by command “ cd ” and for exit command “ cd.. “


Step 6 : Compile to file with “ csc <file_name>.cs “



Step : 7 Execute program with “ <file name>.exe dot_net c_csharp “



0 comments:

Post a Comment

Do not enter spam link

Popular Posts