Users Pricing

forum

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

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

Anonymous User 2883 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.


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md