Results 1 to 8 of 8

Thread: Application Arguements

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2008
    Posts
    90

    Arrow Application Arguements

    Hi,
    My intentions are to add command line switching. I am trying to see if i could run my application in varoius ways i.e.

    App.exe -S - Start the application in XX Mode

    app.exe -T30 - Start application with 30 second delay

    and that kinda switching.

    Thanks
    Stuart

  2. #2
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: Application Arguements

    Thats not really a question - do you mean how would you do it?

    http://www.devx.com/dotnet/Article/10115

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2008
    Posts
    90

    Re: Application Arguements

    Hi, Yeah i realise how i put it sorry for that, i am looking at how to do it.

    Will look at the link.

    Thanks

  4. #4
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,950

    Re: Application Arguements

    If you want to test your app with different command line arguments, you can do that in the IDE.

    Go to Project -> YourApp Properties... -> Debug and enter them into the text box.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    May 2008
    Posts
    90

    Re: Application Arguements

    Hi, thanks for all of the replies. I have looked at the example in the link above but it is for a console application. is there a way of doing it for a windows application

    Thanks
    Stu

  6. #6
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,950

    Re: Application Arguements

    Yes, you can access the arguments using;

    Code:
            'Test for arguments using
            Dim NumberOfArgs As Integer = Environment.GetCommandLineArgs.Length
    
            Dim MyApp As String = Environment.GetCommandLineArgs(0)
            Dim FirstArgument As String = Environment.GetCommandLineArgs(1)
    The first argument is the command, which is the yourapplication.exe part.

  7. #7
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: Application Arguements

    The same applies in windows app as console app : the Command object allows access to command line parameters.

    As Bulldog says above you can test this by setting them via the Debug tab of your projects properties page.

  8. #8

    Thread Starter
    Lively Member
    Join Date
    May 2008
    Posts
    90

    Resolved: Application Arguements

    Hi, you guys are a great help

    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width