JUST DO IT ~

          我只想當個程序員

          Invoke 異常無法定位到具體的行要小心

           public void ShowAppendLog(LoggingEvent[] events)
                  {
                      if (lstInfo.InvokeRequired)
                      {
                          delegateShowAppendLog dd = new delegateShowAppendLog(ShowAppendLog);
                          object[] x = new object[] { events };
                          
                              lstInfo.Invoke(dd, x);  ---errror 1
                                             
                         
                      }
                      else
                      {


                          lstInfo.BeginUpdate();
                          try
                           {                 

                               -----  errror2
                              }catch
                  
                      }
          }

          ---errror 2  真正發(fā)生異常的地方
           e
          {"未將對象引用設置到對象的實例。"}
              [System.NullReferenceException]: {"未將對象引用設置到對象的實例。"}
              Data: {System.Collections.ListDictionaryInternal}
              HelpLink: null
              InnerException: null
              Message: "未將對象引用設置到對象的實例。"
              Source: "System.Windows.Forms"
              StackTrace: "   在 System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)\r\n   在 System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)\r\n   在 fundoffer.frmMain.ShowAppendLog(LoggingEvent[] events) 位置 

              TargetSite: {System.Object MarshaledInvoke(System.Windows.Forms.Control, System.Delegate, System.Object[], Boolean)}
          e.InnerException
          null
          e.InnerException.Message
          “e.InnerException”為 null
          e.InnerException
          null

          ---errror 1  無法定位到行號
          e
          {"未將對象引用設置到對象的實例。"}
              [System.NullReferenceException]: {"未將對象引用設置到對象的實例。"}
              Data: {System.Collections.ListDictionaryInternal}
              HelpLink: null
              InnerException: null
              Message: "未將對象引用設置到對象的實例。"
              Source: "fundoffer"
              StackTrace: "   在 fundoffer.frmMain.ShowAppendLog(LoggingEvent[] events) 位置  form\\frmMain.cs:行號 120"
              TargetSite: {Void ShowAppendLog(log4net.Core.LoggingEvent[])}

          posted on 2009-12-29 13:42 小高 閱讀(795) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導航:
           

          導航

          <2009年12月>
          293012345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          統(tǒng)計

          常用鏈接

          留言簿(3)

          隨筆分類(352)

          收藏夾(19)

          關注的blog

          手冊

          搜索

          積分與排名

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 永定县| 延安市| 乌海市| 雅安市| 崇左市| 武山县| 芒康县| 霞浦县| 济源市| 江达县| 申扎县| 巴中市| 惠东县| 桐柏县| 枝江市| 清丰县| 泰宁县| 景德镇市| 宿州市| 新巴尔虎右旗| 班戈县| 福安市| 皮山县| 隆回县| 富锦市| 昌都县| 惠安县| 修文县| 兰西县| 平凉市| 博罗县| 焉耆| 岱山县| 土默特左旗| 乐都县| 嵊州市| 获嘉县| 陇川县| 靖西县| 呈贡县| 修文县|