Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
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?
  • *Experts*
Posted
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.
Posted

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

  • *Experts*
Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...