将字符串传递给main

时间:2018-01-23 01:03:03

标签: c#

我有以下代码:

static void Main(string[] args)
{
    string edifile = args[0].ToString();
    string editype = args[1].ToString();
    string orderpath = @"C:\Tremor\MXSG\Orders\";

    ReadPurchaseOrders(edifile, orderpath, editype);
}

在批处理文件中,我传递字符串参数:

  

启动C:\ Tremor \ EDIHUB \ ReadEDI.application   “C:\ TEMP \ testedi \ Arrow_ORDERS_D97A_1_20171002_053002_0000038641.txt”   “EdifactOrders”

错误说:

Index was outside the bounds of the array.  

为什么我会收到此错误的任何想法?任何帮助,将不胜感激!

0 个答案:

没有答案