当前位置:网站首页>Unit-- read Excel
Unit-- read Excel
2022-07-27 21:33:00 【Gragragra】
1.unity Read excel file . Need to import 3 individual dll File to Plugins Under the folder .
Namely :Excel.dll EPPlus.dll and ICSharpCode.SharpZipLib.dl
link : https://pan.baidu.com/s/1aLzl7RLZgc8Erp-ihzdYgA?pwd=2jik Extraction code : 2jik2. Code section
using System.Data;
using System.IO;
using Excel;
public class ExcelManager : Monobehaviour
{
void Start()
{
ReadExcel("/ExcelTest.xlsx"));
}
public void ReadExcel(string xmlName)
{
FileStream stream = File.Open(Application.dataPath + xmlName, FileMode.Open, FileAccess.Read, FileShare.Read);
//IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(stream);// Read Excel 1997-2003 edition
IExcelDataReader excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream);// Read 2007 And later versions
DataSet result = excelReader.AsDataSet();
if (stream != null)
{
stream.Close();
}
//return result.Tables[0];
int rows = result.Tables[0].Rows.Count;
int columns = result.Tables[0].Columns.Count;
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < columns; j++)
{
Debug.LogError(result.Tables[0].Rows[i][j].ToString());
}
}
}
}边栏推荐
- 说明书丨Worthington逆转录酶、重组 HIV 检测方案
- Postgresql源码(65)新快照体系Globalvis工作原理分析
- DAY_ 4. Operation -- judge whether there is a certain data in the array -- realize array mapping (enlarge by 10 times) -- insert the array in sequence (modify bugs) -- realize array de duplication
- STL源码剖析
- The solution that the laptop can connect to WiFi but the browser cannot open the web page
- Unity 安装个人免费版
- 飞桨框架体验评测交流会,产品的使用体验由你来决定!
- Traps and limitations of Engineering Technology Development
- Paper appreciation [aaai18] meta multi task learning for sequence modeling
- Rust variable characteristics
猜你喜欢

Unity 安装个人免费版

Report design - how to make your powerbi Kanban brilliant?

建筑云渲染的应用正在扩大,越来越多的行业急需可视化服务

Postgresql源码(65)新快照体系Globalvis工作原理分析

Characteristics and determination scheme of Worthington mushroom polyphenol oxidase
![[day_4-review, basic concepts of objects and arrays - 1]](/img/57/750f12d5315b682d2aeec81f39dafb.png)
[day_4-review, basic concepts of objects and arrays - 1]

Characteristics of exonuclease in Worthington venom and related literature

A review of component parsing (Second Edition)

枚举Enum的简单使用

基于DSP 回传音通话降噪链路设计
随机推荐
Verilog HDL中的reg型变量的理解
Characteristics of exonuclease in Worthington venom and related literature
Thesis appreciation [emnlp18] uses sequence tagging for component parsing
Mysql 回表、SQL优化、四种隔离级别、三大日志binlog、redo log、undo log
C语言-入门-语法-指针(十二)
工程技术开发的圈套与局限性
A new technical director asked me to do an IP territorial function~
Report design - how to make your powerbi Kanban brilliant?
MobileVIT学习笔记
How to check whether there is Tsinghua source / delete Tsinghua source and keep the default source
数字化工厂系统有什么现实优势
行为级描述与RTL级描述
新来个技术总监要我做一个 IP 属地功能~
综合设计一个OPPE主页--页面的搜素欧珀部分的样式
R language uses dplyr package to connect two dataframe data (left join)
大佬们,mysql版本低,不支持cdc,所以canal同步binlog至kafka,数据同步至cli
最高7.5Gbps!全球首款5nm 5G基带骁龙X60发布:支持聚合全部主要频段!
Sre related question answering
Yyds dry inventory learn how to write function overloads in typescript
Simple use of express web server