110,533
社区成员
发帖
与我相关
我的任务
分享
private void Form1_Load(object sender, EventArgs e)
{
String[] arguments = Environment.GetCommandLineArgs();
if (arguments.Length >= 2)
{
for (int i = 1; i <= arguments.Length - 1; i++)
{
filepath = arguments[i];
//例Form2是你打开N个窗体中的一个
new Form2(filepath).show();
}
}
}
private string path = string.Empty;
public Form2(string _path)
{
InitializeComponent();
this.path = _path;
}
/*
* 下面的方法中或是 在Form2的构造中你就可以使用path了,
*/