Control Study -> 用Process调用其它应用程序
2007-12-14 11:48
399 查看
2005年10月07日 22:13:00
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Diagnostics;
namespace WindowsApplication3
{
/// >summary<
/// Form1 的摘要说明。
/// >/summary<
public class Form1 : System.Windows.Forms.Form
{
private System.ComponentModel.IContainer components;
private System.Diagnostics.Process process;
private System.Windows.Forms.Button button1;
//Form2 a;
//Graphics g=pictureBox1.CreateGraphics();
public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// >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.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(136, 144);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click_1);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(344, 302);
this.Controls.Add(this.button1);
this.HelpButton = true;
this.Name = "Form1";
this.Text = "Form1";
this.HelpRequested += new System.Windows.Forms.HelpEventHandler(this.Form1_HelpRequested);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint);
this.ResumeLayout(false);
}
#endregion
/// >summary<
/// 应用程序的主入口点。
/// >/summary<
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_HelpRequested(object sender, System.Windows.Forms.HelpEventArgs hlpevent)
{
}
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
}
private void button1_Click_1(object sender, System.EventArgs e)
{
process=new Process();
process.StartInfo.FileName="skate.exe";
//process.StartInfo.FileName=@"F:/c#/拼图游戏2/bin/Release/拼图游戏2.exe";
this.process.Start();
}
private void pictureBox1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
}
}
}
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=496752
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Diagnostics;
namespace WindowsApplication3
{
/// >summary<
/// Form1 的摘要说明。
/// >/summary<
public class Form1 : System.Windows.Forms.Form
{
private System.ComponentModel.IContainer components;
private System.Diagnostics.Process process;
private System.Windows.Forms.Button button1;
//Form2 a;
//Graphics g=pictureBox1.CreateGraphics();
public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// >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.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(136, 144);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click_1);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(344, 302);
this.Controls.Add(this.button1);
this.HelpButton = true;
this.Name = "Form1";
this.Text = "Form1";
this.HelpRequested += new System.Windows.Forms.HelpEventHandler(this.Form1_HelpRequested);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint);
this.ResumeLayout(false);
}
#endregion
/// >summary<
/// 应用程序的主入口点。
/// >/summary<
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_HelpRequested(object sender, System.Windows.Forms.HelpEventArgs hlpevent)
{
}
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
}
private void button1_Click_1(object sender, System.EventArgs e)
{
process=new Process();
process.StartInfo.FileName="skate.exe";
//process.StartInfo.FileName=@"F:/c#/拼图游戏2/bin/Release/拼图游戏2.exe";
this.process.Start();
}
private void pictureBox1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
}
}
}
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=496752
相关文章推荐
- Control Study -> 用Process调用其它应用程序
- Control Study -> 用Process调用其它应用程序
- 用Process调用其它应用程序 (转)
- <4>Android HAL层 基础及调用
- 在Matlab中调用C/C++程序<四>
- 当php内置函数需要以字符串格式调用&quot;$this-&gt;fun名&quot;类内函数时写法
- c# 中 EventHandler<TEventArgs>的 异步调用
- 【事务】<查询不到同一调用方法其它事务提交的更新>解决方案
- OnNewDocument 不自动调用,必须要我点击菜单->新建的时候再调用,如何做?
- Android清单文件详解(三)----应用程序的根节点<application>
- 只有在配置文件或 Page 指令中将 enableSessionState 设置为 true 时,才能使用会话状态。还请确保在应用程序配置的 <configuration>
- Android自定义抓包调用其它应用程序
- JNI-->C调用Java语言
- <错误处理> Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessExc
- 3G之Android学习第二章节<<开发第一个HelloWorld应用程序>>
- [翻译]Kean' Blog 在一个.NET应用程序中调用AutoCAD
- 如何捕获系统应用程序的界面&&调用系统的下载管理(Downloads)界面
- Form Query Process Flow(F11 -> Ctrl+F11)
- Control Study -> 键盘模拟鼠标(实现用键盘操作鼠标光标)(示例代码下载)
- Control Study -> 自定义DataGrid翻页控件(示例代码下载)