本文主要描述使用Aspose.cells处理excel表格的类,用于批量测试工具的,自己写的,不足之处还是很多的
包含三个方法
1.加载excel表格,会判断excel是2007还是2003
2.sheet处理
3.行处理
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using Aspose.Cells;
using System.IO;
using System.Configuration;
class ProcessExcel
{
//初始化excel
public Workbook ImportExcel(string inputFile)
{
try
{
Workbook workBook = new Workbook();
FileStream fs = new FileStream(ConfigurationSettings.AppSettings["InputFile"], FileMode.Open);
int firstIndex=inputFile.LastIndexOf(".");
string fileType = inputFile.Substring(firstIndex);
if (fileType == ".xls")
{
workBoo