简体   繁体   English

如何使用EPPlus读取具有工作簿保护的Excel 2010文件?

[英]How to use EPPlus read an Excel 2010 file that has workbook protection?

When I use the code below to read an Excel 2010 file that has password protection enabled for the workbook: 当我使用下面的代码读取为工作簿启用密码保护的Excel 2010文件时:

using (FileStream file = new FileStream(fileName,
       FileMode.OpenOrCreate, System.IO.FileAccess.ReadWrite))
{
     ExcelPackage ep = new ExcelPackage();

     try
     {
         ep = new ExcelPackage(file);
     }
     catch (Exception ex)
     {
         string strErr = ex.message;
     }
}

...I get an exception. ......我得到了一个例外。 Any example code to read a Excel 2010 file that has password protection, using EPPlus? 使用EPPlus读取具有密码保护的Excel 2010文件的任何示例代码?

Faced with the same problem. 面对同样的问题。 In Excel 2010 encryption algorythm is differs from 2007. Fortunately EPPlus 4.0 Beta 2 was released . 在Excel 2010中,加密算法与2007年不同。幸运的是,EPPlus 4.0 Beta 2 已经发布 Works fine with 2010+, but can not yet decrypt 2007 excel. 适用于2010+,但仍无法解密2007 excel。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM