winform运行时如何接受参数?(示例)

关键是在Main函数中处理,示例如下

using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace WinFormTest
{
    
static class Program
    
{
        
/// <summary>
        
/// 应用程序的主入口点。
        
/// </summary>

        [STAThread]
        
static void Main(string[] args)
        
{
            
foreach (string p in args)
            
{
                MessageBox.Show(
"p=" + p);
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(
false);
            Application.Run(
new Form1());
        }

    }

}
posted @ 2008-01-29 14:32  菩提树下的杨过  阅读(847)  评论(0编辑  收藏  举报