Results 1 to 3 of 3

Thread: [RESOLVED]How to set two command line parameters

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2007
    Posts
    164

    [RESOLVED]How to set two command line parameters

    as i need add the two commandline parameter on debug window.
    /url=
    one is okay
    how can i add two parameter ?

    Use /url= /name=
    or /url= , /name=

    both can't work !! Please help
    Last edited by edwinho; Dec 25th, 2009 at 12:35 AM. Reason: Problem Solved

  2. #2
    Hyperactive Member gonzalioz's Avatar
    Join Date
    Sep 2009
    Location
    <body></body>
    Posts
    508

    Re: How to set two command line parameters

    I use:

    If Command() IsNot Nothing AndAlso Command.Length <> 0 AndAlso Command.Contains("/url")Then

    End If

    I don't know if that's proper way to do it, but it is very user friendly... You can type parameters like this /d/e//urlt#$#$/t and it won't matter. As long as it's somewhere....

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2007
    Posts
    164

    Re: How to set two command line parameters

    Thank !! Problem Solved


    Setting at debug as /url1= /url2=


    exec.exe /url1=http://www.yahoo.com /url2=http://www.google.com

    Code:
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Dim inputArgument1 As String = "/url1="
            Dim inputargument2 As String = "/url2="
            Dim inputName1 As String = ""
            Dim inputName2 As String = ""
    
            For Each s As String In My.Application.CommandLineArgs
                If s.ToLower.StartsWith(inputArgument1) Then
                    inputName1 = s.Remove(0, inputArgument1.Length)
                End If
    
                If s.ToLower.StartsWith(inputargument2) Then
                    inputName2 = s.Remove(0, inputargument2.Length)
                End If
    
            Next
            If inputName1 = ""  or inputName2="" Then
    
                Exit Sub
            Else
                TextBox1.Text = " " & inputName1 & "  " & inputName2
                WebBrowser1.Navigate(inputName1)
                WebBrowser2.Navigate(inputName2)
    
    
            End If
    Last edited by edwinho; Dec 25th, 2009 at 12:29 AM.

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