在VS C#2003中,我们通过下面的方法获取启动参数:
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args) 
{
}
在2005中好象封装了该函数,那么如何获得启动参数呢?

解决方案 »

  1.   

    找到地方了,原来在programe.cs中
      

  2.   

    我来接吧,这样的话只能用全局变量传给窗口你可以重载窗口的构造函数/// <summary>
    /// 应用程序的主入口点。
    /// </summary>
    [STAThread]
    static void Main(string[] args) 
    {
    Application.Run(new Form1(args))
    }------------------------
    public Form1(string[] args)
    {
       使用args
    }这样就不用全局变量了
      

  3.   

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