baby_vb Posted February 3, 2004 Posted February 3, 2004 I'm 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? Quote
*Experts* mutant Posted February 3, 2004 *Experts* Posted February 3, 2004 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. Quote
baby_vb Posted February 3, 2004 Author Posted February 3, 2004 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 Quote
*Experts* mutant Posted February 3, 2004 *Experts* Posted February 3, 2004 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: C:\appname.exe -count 2 234 234 Of course you could do that any way you want. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.