急,关于读取压缩文件的问题
请教各位,我在读取压缩文件包中的一个文件时出错.
这句读不出数据流: inputStream = zip.GetInputStream(entry);
代码如下:
public List <ReportInputResult> SubmitReport(System.IO.Stream stream, DateTime reportDuration, Guid reportOrganID, int adminorganType, ReportPeriod period)
{
List <ReportInputResult> resultList = new List <ReportInputResult> ();
//从压缩包中读取报表编码
ZipFile zip = new ZipFile(stream);
foreach (ZipEntry entry in zip)
{
if (entry.IsFile && (entry.Name.EndsWith( ".xls ") || entry.Name.EndsWith( ".XLS "))) {
ReportInputResult result = new ReportInputResult();
Stream inputStream;
ExcelDataSheetReader excelSheet;
string reportType;
try//判断上传的文件是否是EXCEL文件
{
inputStream = zip.GetInputStream(entry);
excelSheet = new ExcelDataSheetReader(inputStream, 0);
excelSheet.SkipToRow(1);
excelSheet.SkipToColumn(1);
reportType = excelSheet.Read();