Arun Kurmi

Arun Kurmi

  • NA
  • 104
  • 103.8k

Run Console Application with Command prompt

Mar 21 2013 4:02 PM
hi friends,
I created a C# Application with a Plain Text Editor.I faced problem when running it with command prompt.I read some article on the internet but also facing problem.
I want how to run this app with cmd prompt and also with Visual Studio 2010(framework 4.0).

Here is my code saved in D\Data drive as FirstConsole.cs


Using System;

namespace Test{
class commandline
   {
      static void Main(string[]args)
          {
              if(args.length==0)
                 {
                    console.WriteLine("Plz enter a value");
                 }
              else
                 {
                    for(int i=0;i<args.Length;i++)
                         {
                             console.WriteLine("i="+i+"value="+args[i]);
                         }
                 }
          }
   }}

Answers (3)