Comand line parameters in Visual Studio

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • CSharpUser

    Comand line parameters in Visual Studio

    How do I pass in command line parameters to the program at
    startup in Visual Studio.

    This is similar to doing csc program arg1 arg2.

    I want to achieve the same effect running the program in
    Visual Studio and pressing F5
  • Cybertof

    #2
    Re: Comand line parameters in Visual Studio

    Declare your startup main procedure like this

    static void Main(string[] cmdLine )

    and then you can parse the cmdLine string array.


    Hope this helps.
    Cybertof.


    In article <0f7201c39d75$8 b1aa6e0$a501280 a@phx.gbl>,
    anonymous@discu ssions.microsof t.com says...[color=blue]
    > How do I pass in command line parameters to the program at
    > startup in Visual Studio.
    >
    > This is similar to doing csc program arg1 arg2.
    >
    > I want to achieve the same effect running the program in
    > Visual Studio and pressing F5
    >[/color]

    Comment

    • Thomas Tomiczek \(MVP\)

      #3
      Re: Comand line parameters in Visual Studio

      "CSharpUser " <anonymous@disc ussions.microso ft.com> wrote in message
      news:0f7201c39d 75$8b1aa6e0$a50 1280a@phx.gbl.. .[color=blue]
      > How do I pass in command line parameters to the program at
      > startup in Visual Studio.[/color]

      Project Properties, Configuration Properties, Debugging. There is a line
      (under Startup Options) called "Comand Line Arguments".
      [color=blue]
      > This is similar to doing csc program arg1 arg2.[/color]

      No. csc is the COMPILER. do ou want to pass parameters oto the compiler or
      your program?
      [color=blue]
      > I want to achieve the same effect running the program in
      > Visual Studio and pressing F5[/color]

      As said.

      Thomas Tomiczek
      THONA Software & Consulting Ltd.
      (Micrsofot MVP C#/.NET)


      Comment

      • Guest's Avatar

        #4
        Re: Comand line parameters in Visual Studio

        Thanks. That is what I was looking for.[color=blue]
        >-----Original Message-----
        >"CSharpUser " <anonymous@disc ussions.microso ft.com> wrote[/color]
        in message[color=blue]
        >news:0f7201c39 d75$8b1aa6e0$a5 01280a@phx.gbl. ..[color=green]
        >> How do I pass in command line parameters to the program at
        >> startup in Visual Studio.[/color]
        >
        >Project Properties, Configuration Properties, Debugging.[/color]
        There is a line[color=blue]
        >(under Startup Options) called "Comand Line Arguments".
        >[color=green]
        >> This is similar to doing csc program arg1 arg2.[/color]
        >
        >No. csc is the COMPILER. do ou want to pass parameters oto[/color]
        the compiler or[color=blue]
        >your program?
        >[color=green]
        >> I want to achieve the same effect running the program in
        >> Visual Studio and pressing F5[/color]
        >
        >As said.
        >
        >Thomas Tomiczek
        >THONA Software & Consulting Ltd.
        >(Micrsofot MVP C#/.NET)
        >
        >
        >.
        >[/color]

        Comment

        Working...