using System;using System.Collections.Generic;using System.Linq;using System.Windows.Forms; namespace WindowsFormsApplication8{ static class Program { ...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace WindowsFormsApplication8
{
static class Program
{
/// <summary>
/// 應用程式的主入口點。
/// </summary>
[STAThread]
public static void Main(string[] args) //加參數,接收值,當通過拖拽文件啟動程式時,則參數數組的第一個值就是這個文件的路徑
{
if (args.Count()>0)
{
MessageBox.Show(args[0]);
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}