Results 1 to 3 of 3

Thread: [RESOLVED] Launch program with arguments passed from another application

  1. #1

    Thread Starter
    Frenzied Member stateofidleness's Avatar
    Join Date
    Jan 2009
    Posts
    1,780

    Resolved [RESOLVED] Launch program with arguments passed from another application

    Gentlemen,
    I have an application made by a Vendor that sends a set of arguments to an application I am working on.

    I am unsure how to "launch" my application with these arguments. The vendor's app is a service that runs and launches my application when necessary.

    I'm assuming i need to modify the main form's constructor, but not sure.

  2. #2

    Thread Starter
    Frenzied Member stateofidleness's Avatar
    Join Date
    Jan 2009
    Posts
    1,780

    Re: Launch program with arguments passed from another application

    the format of the arguments I am to receive is this:

    vb Code:
    1. live live 100.100.100.100 53705 16 NAME May-29-2009 01:32:03 PM 0061

    I believe they are all strings

  3. #3

    Thread Starter
    Frenzied Member stateofidleness's Avatar
    Join Date
    Jan 2009
    Posts
    1,780

    Re: Launch program with arguments passed from another application

    For others wanting this functionality, here is the code. I had a hard time finding it on the web even though it is a one-liner.

    vb.net Code:
    1. Dim arg() As String = Environment.GetCommandLineArgs()

    It returns an array of all the command line arguments. You must convert each argument to its correct datatype when using it. Also, the first argument is the path to the executable, so you should start fetching arguments at index 1.

    Hope this helps.

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