博客园  :: 首页  :: 新随笔  :: 联系 :: 管理

获取程序的运行参数

Posted on 2011-06-15 17:20  codingsilence  阅读(459)  评论(0编辑  收藏  举报

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();