获取程序的运行参数

来源:互联网 发布:网络机顶盒十大排名 编辑:程序博客网 时间:2024/06/05 02:24

1、

///   <summary>
///   应用程序的主入口点。
///   </summary>
[STAThread]
static   void   Main(string[]   args)  
{
Application.Run(new   Form1(args))
}

------------------------
public   Form1(string[]   args)
{
      使用args
}

2、

任何地方都可用string   []   strArgs=System.Environment.GetCommandLineArgs();