This is a very innefficient way of coding. Have you ever thought about
writing better code?
Currently you have 4 strings in memory, which you then put into an Array,
then loop through appending them to a stringbuilder (which will copy them),
then you ToString() the stringbuilder, copying the string again to pass to
Process.Start()
As it is all hardcoded anyway you would be better off just passing a single
string to the function which would take up less memory and shorten the JIT
Compilation process.
Ciaran
"CroDude" <di***********@zg.htnet.hr> wrote in message
news:cr**********@news1.xnet.hr...
Use Process.Start( program to start, attributes to pass);
program to start is a path to the .exe of the application to start
attributes to pass is a string containing attributes as You would write
them
calling app manually.
You could use String builder to create attributes, something like this:
string[] args = new string[4];
args[0] = " -o";
args[1] = scriptFolder;
args[2] = "_script.txt";
args[3] = _thumbnail.sImagePath;
StringBuilder arguments = new StringBuilder();
foreach(string arg in args)
{
arguments.Append(arg + " ");
}
Process.Start(Preferences.distFix_PTPath , arguments.ToString());
or
Simply build a attribute string like this :
string arguments = " -o " + scriptFolder + " _script.txt " +
_thumbnail.sImagePath;
Process.Start(Preferences.distFix_PTPath , arguments);