使用Aspose.Cells创建和读取Excel文件

 1       Aspose.Cells.License li = new Aspose.Cells.License();
 2             li.SetLicense("Aspose.Cells.lic");
 3             Aspose.Cells.Workbook wk = new Aspose.Cells.Workbook();
 4             Worksheet ws = wk.Worksheets[0];
 5             for (int i = 0; i < 9; i++)
 6             {
 7                 for (int j = 0; j < 9; j++)
 8                 {
 9                     ws.Cells.Rows[i][j].Value = (i + 1) + "*" + (j + 1) + "=" + (i + 1) * (j + 1);
10                 }
11             }
12             wk.Save("d:\\zzz\\d.xls");
13             Console.WriteLine("ok");
14             Console.ReadKey();
posted @ 2019-02-28 21:37  崇尚技术  阅读(1569)  评论(0编辑  收藏  举报