Main(string[] args) 参数可否保留给 Form1 来使用?我写一支小程式想用cmd执行 AP.exe 123
要怎麽做这参数123可以被Form1来调用呢?
要怎麽做这参数123可以被Form1来调用呢?
解决方案 »
- 怎么用C#写个小程序打开一个网页。
- 怎样使选择DataGridView一整行的数据显示在文本框里面呢?
- C# 写的程序在别人的机器上打不开
- 未将对象引用设置到对象的实例
- C#做的服务端程序,为什么,运行一段时间后,程序界面消失了?
- winform中DataSet.WriteXml如何把排序后的DataSet写入xml文件
- 如何使用HttpUtility.UrlEncode()
- 类型“Hello_Window.Hello_Window”中不存在类型名称“dsOne”
- 程序不能运行,在其他机器上。。。
- 菜鸟:使用adapter对dataset fill()时提示出错,不知道什么原因
- 菜鸟问题。。。大虾速来
- json字符串如何序列化为对象
public class program
{
public static string[] s_args = new string[0];
void Main(string[] args)
{
s_args = args;
}
}
使用的时候
program.s_args[0] ....
Form1 _Form1 =new Form1();
_Form1.Tag =args;
Application.Run(_Form1);在FORM1里使用的为 string[] _args =(string[])this.Tag;
f.Args=args[0];
Application.Run(f);
直接
Environment.GetCommandLineArgs