因由Unity 發佈後,無法建立Excle原因,主要是Dll少檔案
提取码:0xso
----------------------------------------------------using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Excel;
using OfficeOpenXml;
using System.IO;
public class TextWriteExcel : MonoBehaviour {
public string filePath = @"C:\Users\JohnLin\Desktop\Result\CKIP.xlsx";
private void Start() {
WriteExcel();
}
public void WriteExcel(){
FileInfo file = new FileInfo(filePath);
if(file.Exists){
file.Delete();
file = new FileInfo(filePath);
}
ExcelPackage package = new ExcelPackage(file);
ExcelWorksheet worksheet = package.Workbook.Worksheets.Add("Test");
worksheet.Cells["A2"].Value = "ID";
package.Save();
}
}
資料來源: https://blog.csdn.net/yupu56/article/details/50580277
------ 結果圖 ------
沒有留言:
張貼留言