unity下跨平台excel读写

  这是之前写的跨windows和ios读写excel的工具,由于原来导表工具引用的第三方读写excel的dll只能在windos下使用,形成要在mac机器上跑PC端或者打包的时候,每次都要先在windows下导表提交,而后在mac上再更新下来才行。因此就须要导表工具跨平台,不依赖第三方dll。
后来在网上了解到07之后的excel都是经过xml保存起来的,最后压缩成Zip文件。你们能够试试把Excel文件的后缀改为zip,而后经过压缩工具来查看。基于此,我研究了几个xml文件的结构和个中关系,实现告终合Zip解压缩+读写xml的方式来读写excel文件。
 
下面是简单的使用
 1     public static void Test()
 2         {
 3             ExcelWorkSheet sheet = new ExcelWorkSheet("xxxx.xlsx");
 4             //
 5             string value1 = sheet.Cells[0, 0];
 6             string value2 = sheet.Cells[1, 1];
 7             string value3 = sheet.Cells[1, 2];
 8             //
 9             sheet.Cells[0, 0] = "test1";
10             sheet.Cells[0, 1] = "1";
11             sheet.Cells[1, 1] = "2";
12             //自动扩充表格到10x10
13             sheet.Cells[10, 10] = "1";
14             sheet.Save();
15 
16         }

 源码下载连接(百度网盘)ios

 连接: https://pan.baidu.com/s/1o8DoAkM 密码: hzchwindows

相关文章
相关标签/搜索