首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

C# WinForm 开发 EXCEL 读入有关问题

2013-01-19 
C# WinForm 开发 EXCEL 读入问题EXCEL 读入代码结构如下: try{using (ExcelComApplication appExcel new

C# WinForm 开发 EXCEL 读入问题
EXCEL 读入代码结构如下:


 try
     {
       using (ExcelComApplication appExcel = new ExcelComApplication())
       {
          …… 处理数据部分
          
         // 当出现数据异常时,直接Return,但是跳出using 特别的慢,数据量大的话得10秒以上才能跳出了
         如:
         //顧客ファイルに必須チェック
                        if (String.IsNullOrEmpty(CustomerNo))
                        {
                            MessageBox.Show(
                                  L4Message.Get("JPE0057"), "ERROR",
                                  MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return;
                        }
          ……
       }
     }
     catch (Exception)
            {
                //ファイルのデータの読込が失敗しました。
                MessageBox.Show(
                               L4Message.Get("JPE0063"), "ERROR",
                               MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }




为什么跳出 using 会特别的慢? winform excel c#
[解决办法]
慢有很多原因  数据量大 读取EXCEL需要的时间就比较长

[解决办法]
内存消耗过大?!

热点排行