读书人

c# 执行dos命令有关问题

发布时间: 2012-03-14 12:01:13 作者: rapoo

c# 执行dos命令问题
大家帮我看看问题出在哪里,执行完后,一点效果也没有。(应该弹出dos出口才对)
string fileName = Path.Combine(Path.GetDirectoryName(this.GetType().Assembly.Location), "moveuser.exe");
ProcessStartInfo expressStartInfo = new ProcessStartInfo();
expressStartInfo.FileName =fileName;
expressStartInfo.Arguments = txtSource.Text.Trim() + " " + txtPurPose.Text.Trim() + " " + "/y/k";
expressStartInfo.CreateNoWindow = true;
expressStartInfo.RedirectStandardError = true;
expressStartInfo.RedirectStandardInput = true;
expressStartInfo.RedirectStandardOutput = true;
expressStartInfo.UseShellExecute = false;
using (Process expressProc = new Process())
{
expressProc.StartInfo = expressStartInfo;
expressProc.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
expressProc.Start();
//expressProc.WaitForExit();


}

[解决办法]
参考
http://blog.csdn.net/yysyangyangyangshan/article/details/6799489
[解决办法]
expressStartInfo.CreateNoWindow = false;

读书人网 >C#

热点推荐