BinaryFormatter serializer = new BinaryFormatter();
using (System.IO.MemoryStream memStream = new System.IO.MemoryStream())
{
memStream.Position = 0;
WebClient webClient = new WebClient();
var obj = webClient.DownloadData(fileName);//fileName 是远程url地址,可以url直接下载
serializer.Serialize(memStream, obj);
workbook = new HSSFWorkbook(memStream); //在这儿就报错了,报错异常在下面
}
异常:ICSharpCode.SharpZipLib.Zip.ZipException: 'EOF in header'
慕后森
相关分类