用Workbook读取Execl数据
List<TbRiskList> riskList = new List<TbRiskList>(); string riskPath = string.Format(@"{0}{1}", Configuration.Instance.TplsFolder, "TbRiskList.xls"); Workbook wb = new Workbook(riskPath); Worksheet sheet = wb.Worksheets[0]; for (int i = 0; i < sheet.Cells.Rows.Count; i++) { if (sheet.Cells[i, 0].Value.ToString() == info.PlanCode) { TbRiskList riskData = new TbRiskList(); riskData.amount = (sheet.Cells[i, 3].Value.ToString().ToInt32() * unit.Insurants.Count).ToString("#0.00"); riskData.kindCCode = sheet.Cells[i, 1].Value.ToString(); riskData.itemCCode = sheet.Cells[i, 2].Value.ToString(); riskList.Add(riskData); } }