首页 > 代码库 > C#开发命令执行驱动程序 之 读入命令行参数
C#开发命令执行驱动程序 之 读入命令行参数
/// <summary>
/// 在cmd窗体内执行如下:
/// OrderDriverApp.exe Order Driver App
/// 返回:
/// The args array contains 3 entries!
/// args0 = Order
/// args1 = Driver
/// args2 = App
/// </summary>
/// <param name="args"></param>
static void Main(string[] args)
{
Console.WriteLine(string.Format("The args array contains {0} entries!", args.Length));
if (args.Length > 0)
{
IEnumerator arrIEnum = args.GetEnumerator();
int i = 0;
while (arrIEnum.MoveNext())
{
Console.WriteLine(string.Format("args{0} = {1}\n", i, arrIEnum.Current));
i++;
}
}
Console.ReadKey();
}
C#开发命令执行驱动程序 之 读入命令行参数