[Solved] ProcessStartInfo.Arguments – Constants


You contradict yourself in the question by stating you need to use constants yet ask how to use variables – they’re diametrically opposed as far as the ideas go. One is constant the other is variable. Currently you use literals to construct your inputs, so you can swap them out easily enough.

If you want to use constants for the receiving process’s arguments, then, for example, do:

const string ProcessExe = "sbsmutator.exe";
const string OutputName = "--output-name";

And string them together, or use string.Format and such:

startInfo.FileName = ProcessExe;
startInfo.Arguments = string.Format("{0} {1}", OutputName, SomeOtherConstant);

And so on.

Using variables would be very similar, only it likely doesn’t make sense to have such things as alterable reusables.

solved ProcessStartInfo.Arguments – Constants