P
pyrexia
Greets all. I'm attempting to write an app that will be used as a
'control/launcher' application for other apps. For the sake of argument
let's say the app is launched from a command line:
controlapp externalapp argument1 argument2 argument3 argument4...etc.
(number of arguments is ALWAYS dynamic)
I'm been able to get the array passed properly, but ONLY when I know in
advance the amount of items in the array. I'm stuck on how to allow for
any amount of arguments.
Dim applaunch As Process = New Process()
Dim arrayCount As Integer, appArgs() As String
'pull external exe path/name and arguments into array, then count array
items
appArgs = System.Environment.GetCommandLineArgs
For arrayCount = 0 To UBound(appArgs)
Next arrayCount
'command line = controlapp externalapp argument1 argument2 argument3
'I start at 2nd item in array, as appargs(0) = controlapp
applaunch.StartInfo.FileName = appArgs(1)
applaunch.StartInfo.Arguments = appArgs(2) & " " & appArgs(3) & " " &
appArgs(4)
Hopefully this is enough of the code to figure out what my next step should
be. I'm learning as I go with vb.net, so if I missed an incredibly obvious
solution, please be gentle! Additionally, is this even a good way of doing
it? Thanks in advance!
'control/launcher' application for other apps. For the sake of argument
let's say the app is launched from a command line:
controlapp externalapp argument1 argument2 argument3 argument4...etc.
(number of arguments is ALWAYS dynamic)
I'm been able to get the array passed properly, but ONLY when I know in
advance the amount of items in the array. I'm stuck on how to allow for
any amount of arguments.
Dim applaunch As Process = New Process()
Dim arrayCount As Integer, appArgs() As String
'pull external exe path/name and arguments into array, then count array
items
appArgs = System.Environment.GetCommandLineArgs
For arrayCount = 0 To UBound(appArgs)
Next arrayCount
'command line = controlapp externalapp argument1 argument2 argument3
'I start at 2nd item in array, as appargs(0) = controlapp
applaunch.StartInfo.FileName = appArgs(1)
applaunch.StartInfo.Arguments = appArgs(2) & " " & appArgs(3) & " " &
appArgs(4)
Hopefully this is enough of the code to figure out what my next step should
be. I'm learning as I go with vb.net, so if I missed an incredibly obvious
solution, please be gentle! Additionally, is this even a good way of doing
it? Thanks in advance!