C#启动另外一个C#程序,并传递参数
2015-08-19 10:36
411 查看
第一个程序:
using System.ComponentModel;
using System.IO;
private void button1_Click(object sender, EventArgs e)
{
string target = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName)
+ @"\TCPDownAndCOM.exe";
Process.Start(target,"你好");
}
第二个程序,在Program.cs文件中。
using System;
using System.Linq;
using System.Collections.Generic;
using System.Windows.Forms;
namespace TCPDownAndCOM
{
static class Program
{
///
/// The main entry point for the application.
///
[MTAThread]
static void Main(string[] args)
{
GPS_zw.ClassPublicFunction.strPar = args[0];
Application.Run(new Form1());
}
//static void Main()
//{
// //strPar = args[0];
// Application.Run(new Form1());
//}
}
}
using System.ComponentModel;
using System.IO;
private void button1_Click(object sender, EventArgs e)
{
string target = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName)
+ @"\TCPDownAndCOM.exe";
Process.Start(target,"你好");
}
第二个程序,在Program.cs文件中。
using System;
using System.Linq;
using System.Collections.Generic;
using System.Windows.Forms;
namespace TCPDownAndCOM
{
static class Program
{
///
/// The main entry point for the application.
///
[MTAThread]
static void Main(string[] args)
{
GPS_zw.ClassPublicFunction.strPar = args[0];
Application.Run(new Form1());
}
//static void Main()
//{
// //strPar = args[0];
// Application.Run(new Form1());
//}
}
}
相关文章推荐
- c# 查询 插入 access db 2007
- c#索引器
- C#精髓 第四讲 GridView 72般绝技
- 【C#】窗体动画效果
- C#多态性详解
- C# interface学习经验浅谈
- C#-JudgeSystem判题系统-安装和熟悉C#开发环境
- C#-JudgeSystem判题系统-客户端和多线程
- C#-JudgeSystem判题系统-C#编译C程序
- C#-JudgeSystem判题系统-判题系统
- C#-JudgeSystem判题系统-开放实验总结
- 《C#入门经典》笔记
- 关于一个给二维数组循环赋值问题的本渣研究出的解决办法[C#]
- 用C#给程序加启动画面并只允许一个应用程序实例运行
- System.Reflection.BindingFlags 说明
- C#程序开发中经常遇到的10条实用的代码
- 使用C#选择文件夹、打开文件夹、选择文件
- c#创建窗体,向窗体添加控件,设置控件大小位置等属性,写控件的响应
- C#基础--之数据类型
- C# string[,]与string[][]的区别