0
我的一位朋友在工作中找到我,问他为什么不能正确运行该代码。C#和OpenSSL可执行文件
using System.Diagnostics;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
ProcessStartInfo startInfo = new ProcessStartInfo();
string processExecutable = "C:\\OpenSSL-Win32\\bin\\openssl.exe";
startInfo.FileName = processExecutable;
startInfo.Arguments = @"genrsa -out Prvkey.key";
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;
startInfo.RedirectStandardInput = true;
startInfo.CreateNoWindow = true;
Process.Start(startInfo);
}
}
}
,当他使用openSSL.exe,定期,单击.exe文件,并把指令“genrsa -out Prvkey.key”,它工作正常。所以它不是说明本身,而是如何通过。 任何想法?
什么问题? – alexl 2011-02-23 15:04:12