wangchao.org
添加收藏 | 博客
 
购物视频论坛IT业界自然风光美女图片王朝网络小游戏BT下载生活百科编程设计手机图片小说
 
笑话 | 水库 | 娱乐 | 体育 | 英语 | 宠物 | 美食 | 旅游 | 养生 | 手机 | 数码 | 汽车 | 珠宝 | 美容 | 装修 | 厨房 | 科普 | 动物 | 植物 | 影音 | 百科 | 知道 | 词典
  
 
 您好! 您现在位于: 王朝网络 → 编程设计 → 《做一个Windows窗体版的DOS分析器返回上一页 
 
1楼 

做一个Windows窗体版的DOS分析器

  网上购物、在线购物、购物搜索 欢迎光临本站购买图书、影视、音乐、数码、百货,手机等商品。

  

  ////////////////////////////////////////////////////////////////////////////////
  //Author: stardicky //
  //E-mail: stardicky@hotmail.com //
  //QQNumber: 9531511 //
  //CompanyName: Ezone International //
  //Class: HBS-0308 //
  //title: 做一个Windows窗体版的DOS分析器 //
  ////////////////////////////////////////////////////////////////////////////////
  using System;
  using System.Drawing;
  using System.Collections;
  using System.ComponentModel;
  using System.Windows.Forms;
  using System.Data;
  using System.Diagnostics;
  namespace EzoneDOSApp
  {
  /// <summary>
  /// Form1 的摘要说明。
  /// </summary>
  public class Form1 : System.Windows.Forms.Form
  {
   private System.Windows.Forms.TextBox txtCmd;
   private System.Windows.Forms.Button btnOK;
   private System.Windows.Forms.RichTextBox rtbResult;
   /// <summary>
   /// 必需的设计器变量。
   /// </summary>
   private System.ComponentModel.Container components = null;
   private Process ProcessCmdObject;
   public Form1()
   {
   //
   // Windows 窗体设计器支持所必需的
   //
   InitializeComponent();
   //
   // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
   //
   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();
   }
   /// <summary>
   /// 清理所有正在使用的资源。
   /// </summary>
   protected override void Dispose( bool disposing )
   {
   if( disposing )
   {
   if (components != null)
   {
   components.Dispose();
   }
   }
   base.Dispose( disposing );
   }
   #region Windows 窗体设计器生成的代码
   /// <summary>
   /// 设计器支持所需的方法 - 不要使用代码编辑器修改
   /// 此方法的内容。
   /// </summary>
   private void InitializeComponent()
   {
   this.txtCmd = new System.Windows.Forms.TextBox();
   this.btnOK = new System.Windows.Forms.Button();
   this.rtbResult = new System.Windows.Forms.RichTextBox();
   this.SuspendLayout();
   //
   // txtCmd
   //
   this.txtCmd.Location = new System.Drawing.Point(0, 0);
   this.txtCmd.Name = "txtCmd";
   this.txtCmd.Size = new System.Drawing.Size(448, 21);
   this.txtCmd.TabIndex = 0;
   this.txtCmd.Text = "";
   //
   // btnOK
   //
   this.btnOK.Location = new System.Drawing.Point(456, 0);
   this.btnOK.Name = "btnOK";
   this.btnOK.TabIndex = 1;
   this.btnOK.Text = "确认";
   this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
   //
   // rtbResult
   //
   this.rtbResult.Location = new System.Drawing.Point(0, 24);
   this.rtbResult.Name = "rtbResult";
   this.rtbResult.Size = new System.Drawing.Size(536, 424);
   this.rtbResult.TabIndex = 2;
   this.rtbResult.Text = "";
   //
   // Form1
   //
   this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
   this.ClientSize = new System.Drawing.Size(536, 445);
   this.Controls.Add(this.rtbResult);
   this.Controls.Add(this.btnOK);
   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
   /// <summary>
   /// 应用程序的主入口点。
   /// </summary>
   [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)
   {
   }
  }
  }

[img]http://dev.csdn.net/Develop/ArticleImages/27/27964/CSDN_Dev_Image_2004-5-172244180.JPG[/img] //////////////////////////////////////////////////////////////////////////////// //Author: stardicky // //E-mail: [url=mailto:stardicky@hotmail.com]stardicky@hotmail.com[/url] // //QQNumber: 9531511 // //CompanyName: Ezone International // //Class: HBS-0308 // //title: 做一个Windows窗体版的DOS分析器 // //////////////////////////////////////////////////////////////////////////////// using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Diagnostics; namespace EzoneDOSApp { /// <summary> /// Form1 的摘要说明。 /// </summary> public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.TextBox txtCmd; private System.Windows.Forms.Button btnOK; private System.Windows.Forms.RichTextBox rtbResult; /// <summary> /// 必需的设计器变量。 /// </summary> private System.ComponentModel.Container components = null; private Process ProcessCmdObject; public Form1() { // // Windows 窗体设计器支持所必需的 // InitializeComponent(); // // TODO: 在 InitializeComponent 调用后添加任何构造函数代码 // 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(); } /// <summary> /// 清理所有正在使用的资源。 /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows 窗体设计器生成的代码 /// <summary> /// 设计器支持所需的方法 - 不要使用代码编辑器修改 /// 此方法的内容。 /// </summary> private void InitializeComponent() { this.txtCmd = new System.Windows.Forms.TextBox(); this.btnOK = new System.Windows.Forms.Button(); this.rtbResult = new System.Windows.Forms.RichTextBox(); this.SuspendLayout(); // // txtCmd // this.txtCmd.Location = new System.Drawing.Point(0, 0); this.txtCmd.Name = "txtCmd"; this.txtCmd.Size = new System.Drawing.Size(448, 21); this.txtCmd.TabIndex = 0; this.txtCmd.Text = ""; // // btnOK // this.btnOK.Location = new System.Drawing.Point(456, 0); this.btnOK.Name = "btnOK"; this.btnOK.TabIndex = 1; this.btnOK.Text = "确认"; this.btnOK.Click += new System.EventHandler(this.btnOK_Click); // // rtbResult // this.rtbResult.Location = new System.Drawing.Point(0, 24); this.rtbResult.Name = "rtbResult"; this.rtbResult.Size = new System.Drawing.Size(536, 424); this.rtbResult.TabIndex = 2; this.rtbResult.Text = ""; // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); this.ClientSize = new System.Drawing.Size(536, 445); this.Controls.Add(this.rtbResult); this.Controls.Add(this.btnOK); 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 /// <summary> /// 应用程序的主入口点。 /// </summary> [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) { } } }

 
标签: DOS  Windows  做一个  分析  版的  窗体  
 
您可以将本页贴到其他网站
UBB代码HTML代码
 
 
 
 
手机图片下载手机图片下载手机图片下载手机图片下载手机图片下载手机图片下载更多图铃
 
 
 
 
 
 
 更多内容
 ·Windows XP SP2之初体验 ·我说windows和linux ·基于PXE启动的WINDOWS 2000/XP的 ·基于PXE启动的WINDOWS 2000/XP的
 ·基于PXE启动的WINDOWS 2000/XP的 ·基于PXE启动的WINDOWS 2000/XP的 ·共享Linux 和Windows Server 200 ·UNIX上的“游戏修改器”
 ·unix上防止程序死锁的一些手段 ·将错误信息记录到Windows日志中. ·在IE浏览器中使用Windows窗体控件 ·在IE浏览器中使用Windows窗体控件
 ·在IE浏览器中使用Windows窗体控件 ·从"在 Internet Explorer 中 ·Windows Server操作系统和本地环 ·用WinRAR制作安装程序
 ·负载均衡更高效 —— Windows Se ·Windows 2000 的注册表备份和恢复 ·Linux下Apache服务器的配置! ·用WinDbg探索CLR世界 [3] 跟踪方
 ·WindowsForm登陆窗体的建立 ·从一个问题程序看Windows的1/10秒 ·IIS6中对站点标识符进行修改 ·Linux编程
 
 
 
最新评论  点此查看所有评论
 
 
 
 
发表评论(支持UBB码)


验证码:  
 
 
 
 
© 2005- 王朝网络 版权所有