Exemple #1
0
 public void LoadData()
 {
     for (int i = 0; i < _inputFiles.Length; i++)
     {
         string path = _inputFiles[i];
         try
         {
             string    ext      = Path.GetExtension(path);
             string    fullType = "list:" + _fullName;
             FieldWrap field    = new FieldWrap(null, Name, fullType, Util.Split(fullType), _groups);
             if (ext == ".xml")
             {
                 var xml = new ImportXml(path);
                 if (_data == null)
                 {
                     _data = new FList(null, field);
                 }
                 _data.LoadOneRecord(xml.Data);
             }
             else
             {
                 var excel = new ImportExcel(path);
                 _data = new FList(null, field, excel);
             }
         }
         catch (Exception e)
         {
             Util.LogErrorFormat("{0}\n[加载文件失败]:{1}\n{2}\n", e.Message, path, e.StackTrace);
         }
     }
 }