Home All Groups Group Topic Archive Search About
Author
29 May 2009 8:06 PM
freddy
I would like to enter aN ipaddress or computername in a textbox and pass it
to a program like so:

        Dim objProcess As System.Diagnostics.Process
        objProcess = New System.Diagnostics.Process()
        objProcess.StartInfo.FileName = "C:\SMSADMIN\bin\i386\remote.exe"
        objProcess.StartInfo.Arguments = "2," & txtworkstation.Text
        objProcess.Start()

The txtworkstation.Text  is where I am putting in the ipaddress and need to
pass it as a string for the Arguments.

This works:
objProcess.StartInfo.Arguments = "2, 10.176.29.40"
Does not work:
objProcess.StartInfo.Arguments = "2," & txtworkstation.Text

Please help me

Author
29 May 2009 8:59 PM
Family Tree Mike
Show quote Hide quote
"freddy" <fre***@discussions.microsoft.com> wrote in message
news:C8D6DD59-4FED-468A-8D43-0F11FD6B46B6@microsoft.com...
>I would like to enter aN ipaddress or computername in a textbox and pass it
> to a program like so:
>
>        Dim objProcess As System.Diagnostics.Process
>        objProcess = New System.Diagnostics.Process()
>        objProcess.StartInfo.FileName = "C:\SMSADMIN\bin\i386\remote.exe"
>        objProcess.StartInfo.Arguments = "2," & txtworkstation.Text
>        objProcess.Start()
>
> The txtworkstation.Text  is where I am putting in the ipaddress and need
> to
> pass it as a string for the Arguments.
>
> This works:
> objProcess.StartInfo.Arguments = "2, 10.176.29.40"
> Does not work:
> objProcess.StartInfo.Arguments = "2," & txtworkstation.Text
>
> Please help me


You don't have a space between the comma and the ip address.  Use the
following:

"2, " & txtworkstation.Text

Or even:

string.Format("2, {0}", txtworkstation.Text)

--
Mike