ProcessStartInfo multiple arguments??

baby_vb

Member
Joined
Nov 3, 2003
Messages
9
Im using System.Diagnostics.ProcessStartInfo but I want to send more than 1 argument to my process, and some of them are integer arrays. If I have several arrays that I want to send, how do I delimit the different indices of the array from the different arguments, or is there an easy, simple way to send multiple arguments in ProcessStartInfo?
 
Usually command line arguments are divided by a space. You could pass in every argument separated by a space, and then use System.Environment.GetCommandLineArgs() method to get the array of strings representing the passed in arguments. The 0 index will always be the file name of the exe so you might as well skipt that.
 
But if you do that and there are several different arrays with no predetermined number of elements in any of them, how do you know which arguments belong to which arraysk

i.e. 1 23 5 65 8 4 67 34 could be parsed as

{1 23 5 65} {8 4 67 34}

or

{1 23} {5 65 8 4 67 34}

etc
 
Well, command line arguments are combined into one string of text (spaces usually divide those). What you could do it make another special character that will represent how many numbers of the next ones will fit into a particular array, something like:
Code:
C:\appname.exe -count 2 234 234
Of course you could do that any way you want.
 
Back
Top