解决方案 »

  1.   

    MacObjList 光初始化,没有添加MacSection对象,count当然是0啊
      

  2.   

    MacObjList  你只 实例化了, MacObjList[0].MacCurrent = macStart;   之前  没有向MacObjList   中Add数据,所以报错。
      

  3.   

    MacSection mac = new MacSection();
    mac.MacCurrent = strMac[0];
    MacObjList.Add(mac);
      

  4.   


    if (macLen == 2)
    {
     string macStart = strMac[0];
     string macEnd = strMac[1];
    MacSection  section = new MacSection();
    section.MacStart  = macStart;
    ....//需要将值给缓存
     MacObjList.Add(section);
    }