***System.Diagnostics.Process调用exe之后怎么取得exe的返回值?
我写的代码如下:
Process pcs = new Process();
pcs.StartInfo.UseShellExecute = false;
pcs.StartInfo.RedirectStandardError = true;
pcs.StartInfo.FileName = "OBCSETUPSDK\\ObcSetupSDK.exe";
pcs.StartInfo.Arguments = string.Format(stringBuilder.ToString(),
entryLicenseRegistry.ProductID,
entryLicenseRegistry.RegistryNo,
entryLicenseRegistry.SetupKey,
Environment.CurrentDirectory);
pcs.StartInfo.RedirectStandardOutput = true;
pcs.Start();
pcs.WaitForExit();
我写的代码如下:
Process pcs = new Process();
pcs.StartInfo.UseShellExecute = false;
pcs.StartInfo.RedirectStandardError = true;
pcs.StartInfo.FileName = "OBCSETUPSDK\\ObcSetupSDK.exe";
pcs.StartInfo.Arguments = string.Format(stringBuilder.ToString(),
entryLicenseRegistry.ProductID,
entryLicenseRegistry.RegistryNo,
entryLicenseRegistry.SetupKey,
Environment.CurrentDirectory);
pcs.StartInfo.RedirectStandardOutput = true;
pcs.Start();
pcs.WaitForExit();
解决方案 »
- asp.net中label问题
- C#发邮件问题
- 关于Jmail的种种不爽……
- WinForm隐藏与关闭的问题
- C#中关于TreeView控件的问题
- 点击模板列中button后,怎样取到同列中的textbox的内容-急,急,急!
- 关于文本文件的操作,在线等,急急急!!!请赐教!!!!
- 用Sqlserver2005 开发版 和C#开发程序如何发布
- 请问:datagrid的某一column添加combox控件後,能否实现每条记录的combox内容不一样?
- 将一个中文字符串转换为byte类型的数组,然后再转回为中文字符串?
- 进来看问题吧,标题里写不开,关于vs2003转2005的问题,涉及到基层了,就出现问题了。
- 新手问题:enum类型是静态的吗,enum为什么不能定义成string类型
*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html
Process pcs = new Process();
pcs.StartInfo.UseShellExecute = false;
pcs.StartInfo.RedirectStandardError = true;
pcs.StartInfo.RedirectStandardOutput = true;
pcs.StartInfo.FileName = "OBCSETUPSDK\\ObcSetupSDK.exe";
pcs.StartInfo.Arguments = string.Format(stringBuilder.ToString(),
entryLicenseRegistry.ProductID,
entryLicenseRegistry.RegistryNo,
entryLicenseRegistry.SetupKey,
Environment.CurrentDirectory);
pcs.StartInfo.RedirectStandardOutput = true;
pcs.Start();
pcs.WaitForExit();
//pcs.e
StreamReader srd = pcs.StandardOutput;
while (srd.Peek() > -1)
{
int result = srd.Read();
}