ralphtrent
Programmer
Hello
I have the following code
When I run this I get the following execption
If I take out the
The process runs with out an issue. I need to read the output of the exe since it writes the output I need on the command line. I did not write this exe so I can not change it. This code is inside a dot net 2.0 class, while my calling app is a 3.5 dot net app. Not sure if that makes a difference or not.
Any help is appreciated.
Thanks,
RalphTrent
I have the following code
Code:
System.Diagnostics.Process lpEncryptPassword = new System.Diagnostics.Process();
lpEncryptPassword.StartInfo.UseShellExecute = false;
lpEncryptPassword.StartInfo.CreateNoWindow = true;
lpEncryptPassword.StartInfo.RedirectStandardOutput = true;
lpEncryptPassword.StartInfo.WorkingDirectory = @"f:\dot-net\c#\PWE\2.0\PWE";
lpEncryptPassword.StartInfo.FileName = "EncryptPassword.exe";
lpEncryptPassword.StartInfo.Arguments = UserName + " " + Password;
string lsEncryptPassword = "";
try
{
lpEncryptPassword.Start();
lsEncryptPassword = lpEncryptPassword.StandardOutput.ReadLine().Remove(0, 21);
}
catch { throw; }
finally
{
lpEncryptPassword = null;
GC.Collect();
}
return lsEncryptPassword;
When I run this I get the following execption
Code:
Message: "The system cannot find the file specified"
If I take out the
Code:
lpEncryptPassword.StartInfo.UseShellExecute = false;
lpEncryptPassword.StartInfo.RedirectStandardOutput = true;
Any help is appreciated.
Thanks,
RalphTrent