Aspose.Cells导入excel文件异常No data is available for encoding 936.

Posted 棉晗榜

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Aspose.Cells导入excel文件异常No data is available for encoding 936.相关的知识,希望对你有一定的参考价值。

Aspose.Cells导入excel文件异常消息:
No data is available for encoding 936.For information on defining a custom encoding,see the documentation for the Encoding.RegisterProvider method.

程序集框架.NET 5

解决办法关键代码:

System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);

完整代码:

public void Test1()
  string path=@"E:\\7789.xlsx";
  System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
  LoadOptions   loadOptinos=new LoadOptions(LoadFormat.Xlsx);
  Aspose.Cells.Workbook  wb=new Aspose.Cells.Workbook(path,loadOptinos);
  
  Aspose.Cells.Worksheet   sheet=wb.Worksheets[0];



参考了文章:
https://blog.csdn.net/sunshineGGB/article/details/121006758

以上是关于Aspose.Cells导入excel文件异常No data is available for encoding 936.的主要内容,如果未能解决你的问题,请参考以下文章