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 2753 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 !


Message
Can you answer this question?

Answer

1 Answers

Liked By