日期:2014-05-18 浏览次数:20993 次
static class Program
{
//外部调用方式:Win.exe <root><userid>1001</userid><password></password></root>
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
string str = (string.Format(("{0}"), args));
//str 就是传递过来的值
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
MessageBox.Show(str);
}
}
------解决方案--------------------
都已经说的很清楚了
we will pass the port number on the argument line of your process
就是他会执行类似于xxx.exe port这样的命令行形式来调用你的程序,参数就在main函数的args中。