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