本帖最后由 Richard.Ma 于 2021-8-2 09:56 编辑
给大量给Tag赋值,20W单元格,花费了35S,性能较差
- var watch = new Stopwatch();
- watch.Start();
- var workbook = new GrapeCity.Documents.Excel.Workbook();
- var currentSheet = workbook.Worksheets[0];
-
- for (var i = 0; i < 15000; i++)
- {
- for (var j = 0; j < 13; j++)
- {
- var curCell = currentSheet.Range[i + 1, j];
- curCell.Value = currentSheet.Rows[j];
- //curCell.Tag = "222222222222222222222222";
- curCell.Tag = [ DISCUZ_CODE_0 ]quot;{currentSheet.Name}|{i + 1}|{j}";
- }
- }
- watch.Stop();
- Console.WriteLine([ DISCUZ_CODE_0 ]quot;执行耗时:{watch.ElapsedMilliseconds}");
复制代码
原帖https://gcdn.grapecity.com.cn/fo ... 94739&extra=&page=2
|