forum

Home / DeveloperSection / Forums / c# How to run program using Command line argument [on hold]

c# How to run program using Command line argument [on hold]

Anonymous User 2470 04-Sep-2013

How to run a program using command line argument for example my program only runs when i say a string e.g Hello World if this value does not match then it should give an error.

if (args == null)

{

    Console.WriteLine("cant be null"); // Check for null array

}

if (args[0].Contains("Hello World"))

{

    Console.WriteLine("True"); // Check for null array

}

else

{

    Console.WriteLine("Error"); // Check for null array

}

Thanks in advance.


c# c# 
Updated on 04-Sep-2013
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By