locked
command line arguments RRS feed

  • Question

  • hi everybody ....im a beginner..can anybody please explain about command line arguments in c#?what is mean by command line arguments??plz help me..plz...

    hashna

    Wednesday, April 18, 2012 8:39 PM

Answers

  • Hi. When you create a new Visual Studio console application you will notice that inside the Program.cs file there is the following code:

    static void Main(string[] args)
    {
            
    }

    The void Main is passed string arguments as parameters 

    string[] args
    These are the command line arguments. They can be passed to your application after the exe. Have a look at this article for a great explanation on command line arguments. Command Line Parameters Tutorial

    I hope that this helps you. Please let me know if you need any more info.


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer. This helps us build a healthy and positive community. Happy programming!

    • Marked as answer by ha.ama Wednesday, April 18, 2012 9:30 PM
    Wednesday, April 18, 2012 8:54 PM
  • Hi,

    Here is a sample C# project on command line arguments parsing: http://www.codeproject.com/Articles/3111/C-NET-Command-Line-Arguments-Parser.

    Kind regards,


    My blog

    Whether you’re a construction worker, a forum moderator, or just someone that likes helping people. I think these guidelines can be helpful in keeping you helpful when being helpful.

    • Marked as answer by ha.ama Thursday, April 19, 2012 7:06 PM
    Thursday, April 19, 2012 11:12 AM

All replies

  • hi,

    if you mean command line arguments in console c# project then check this:

    http://msdn.microsoft.com/en-us/library/cb20e19t(v=vs.80).aspx

    http://msdn.microsoft.com/en-us/library/acy3edy3.aspx

    and this tutorial with source code:

    http://msdn.microsoft.com/en-us/library/aa288457(v=vs.71).aspx



    Jose Mendez.
    Blog
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    Si un Post reponde a tu pregunta, por favor "Marcala como Respondida" y "Vota como útil".

    • Proposed as answer by Jason Dot Wang Thursday, April 19, 2012 8:21 AM
    Wednesday, April 18, 2012 8:52 PM
  • Hi. When you create a new Visual Studio console application you will notice that inside the Program.cs file there is the following code:

    static void Main(string[] args)
    {
            
    }

    The void Main is passed string arguments as parameters 

    string[] args
    These are the command line arguments. They can be passed to your application after the exe. Have a look at this article for a great explanation on command line arguments. Command Line Parameters Tutorial

    I hope that this helps you. Please let me know if you need any more info.


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer. This helps us build a healthy and positive community. Happy programming!

    • Marked as answer by ha.ama Wednesday, April 18, 2012 9:30 PM
    Wednesday, April 18, 2012 8:54 PM
  • thanks a lot for your explanation..i will be thankful if you could please explain it with the help of a simple c# program in console application...thanks once again

    hashna

    Wednesday, April 18, 2012 9:30 PM
  • thanks a lot......

    hashna

    Wednesday, April 18, 2012 9:30 PM
  • could please explain it with the help of a simple c# program in console application?...thanks once again

    hashna

    Thursday, April 19, 2012 10:44 AM
  • Hi,

    Here is a sample C# project on command line arguments parsing: http://www.codeproject.com/Articles/3111/C-NET-Command-Line-Arguments-Parser.

    Kind regards,


    My blog

    Whether you’re a construction worker, a forum moderator, or just someone that likes helping people. I think these guidelines can be helpful in keeping you helpful when being helpful.

    • Marked as answer by ha.ama Thursday, April 19, 2012 7:06 PM
    Thursday, April 19, 2012 11:12 AM
  • thanks

    hashna

    Thursday, April 19, 2012 7:06 PM