S
Saso Zagoranski
Hi!
I'm trying to run a decryption utility (des), which needs the following
parameters:
-D-u -k "key" input.file output.file
If I run this from the command-prompt it works but when I try to run it from
my application (it's a .NET service
but I've also tried running it from a Windows Application) it doesn't work.
The output from StandardError look like the ouput, if I just type "des" in
the command-prompt (it lists
all the possible arguments).
My guess is that something is wrong with the passing of parameters... any
ideas?
Thanks,
saso
The code:
string decName = @"request.dec";
string path = @"request.out.20050222";
Process myProcess = new Process();
ProcessStartInfo myProcessStartInfo = new ProcessStartInfo(@"C:\des.exe" );
myProcessStartInfo.UseShellExecute = false;
myProcessStartInfo.CreateNoWindow = true;
myProcessStartInfo.Arguments = "-D -u -k \"myKey\" request.out.20050222";
myProcessStartInfo.RedirectStandardError = true;
myProcess.StartInfo = myProcessStartInfo;
myProcess.Start();
myProcess.WaitForExit();
StreamReader sr = myProcess.StandardError;
MessageBox.Show(sr.ReadToEnd());
I'm trying to run a decryption utility (des), which needs the following
parameters:
-D-u -k "key" input.file output.file
If I run this from the command-prompt it works but when I try to run it from
my application (it's a .NET service
but I've also tried running it from a Windows Application) it doesn't work.
The output from StandardError look like the ouput, if I just type "des" in
the command-prompt (it lists
all the possible arguments).
My guess is that something is wrong with the passing of parameters... any
ideas?
Thanks,
saso
The code:
string decName = @"request.dec";
string path = @"request.out.20050222";
Process myProcess = new Process();
ProcessStartInfo myProcessStartInfo = new ProcessStartInfo(@"C:\des.exe" );
myProcessStartInfo.UseShellExecute = false;
myProcessStartInfo.CreateNoWindow = true;
myProcessStartInfo.Arguments = "-D -u -k \"myKey\" request.out.20050222";
myProcessStartInfo.RedirectStandardError = true;
myProcess.StartInfo = myProcessStartInfo;
myProcess.Start();
myProcess.WaitForExit();
StreamReader sr = myProcess.StandardError;
MessageBox.Show(sr.ReadToEnd());