正在阅读:做一个Windows窗体版的DOS分析器做一个Windows窗体版的DOS分析器

2004-05-21 10:29 出处:PConline 作者:stardicky 责任编辑:linjixiong
this.Controls.Add(this.txtCmd);    this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;    this.MaximizeBox = false;    this.Name = "Form1"; this.Text = "DOS分析器 - 亿众国际";    this.Closing += new System.ComponentModel.CancelEventHandler(this.Form1_Closing);    this.ResumeLayout(false);       }      #endregion       ///    /// 应用程序的主入口点。    ///    [STAThread]       static void Main()    {    Application.Run(new Form1());    }       private void btnOK_Click(object sender, System.EventArgs e)    {    ProcessCmdObject=new Process();       ProcessCmdObject.StartInfo.FileName="cmd.exe";       ProcessCmdObject.StartInfo.UseShellExecute=false;    ProcessCmdObject.StartInfo.RedirectStandardInput=true;         ProcessCmdObject.StartInfo.RedirectStandardOutput=true;       ProcessCmdObject.StartInfo.RedirectStandardError=true;       ProcessCmdObject.StartInfo.CreateNoWindow=true;       ProcessCmdObject.Start();       ProcessCmdObject.StandardInput.WriteLine(this.txtCmd.Text.Trim());       ProcessCmdObject.StandardInput.WriteLine("exit");       this.rtbResult.Text=ProcessCmdObject.StandardOutput.ReadToEnd()+ProcessCmdObject.StandardError.ReadToEnd();    }       private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)    {    }    }     }               Author: stardicky     E-mail: stardicky@hotmail.com     QQNumber: 9531511     CompanyName: Ezone International     Class: HBS-0308     title: 做一个Windows窗体版的DOS分析器         
察看评论详细内容 我要发表评论
作者笔名 简短内容 发表时间
:
键盘也能翻页,试试“← →”键

关注我们

最新资讯离线随时看 聊天吐槽赢奖品