首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

c# 执行dos命令有关问题

2012-03-14 
c# 执行dos命令问题大家帮我看看问题出在哪里,执行完后,一点效果也没有。(应该弹出dos出口才对)string file

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;

热点排行