jinfeng_wang

          G-G-S,D-D-U!

          BlogJava 首頁 新隨筆 聯系 聚合 管理
            400 Posts :: 0 Stories :: 296 Comments :: 0 Trackbacks

          公告

          歡迎交流鏈接,給我留言

          常用鏈接

          留言簿(40)

          隨筆分類(592)

          隨筆檔案(400)

          Domestic

          Foreign

          搜索

          積分與排名

          最新評論

          閱讀排行榜

          評論排行榜

          class SomeClass
          {
          public int DoSomething()
          {
          ReportError("Here's an error message");
          return 0;
          }

          private void ReportError(string Message)
          {
          // Get the frame one step up the call tree
          StackFrame CallStack = new StackFrame(1, true);

          // These will now show the file and line number of the ReportError
          call in the DoSomething() method
          string SourceFile = CallStack.GetFileName(),
          int SourceLine = CallStack.GetFileLineNumber(),
          MyWriteToFile("Error: " + Message + " - File: " + SourceFile + "
          Line: " + SourceLine.ToString());
          }
          }
          posted on 2007-07-03 14:16 jinfeng_wang 閱讀(711) 評論(0)  編輯  收藏 所屬分類: ZZ.Net
          主站蜘蛛池模板: 林甸县| 广州市| 清镇市| 兰州市| 泸溪县| 民乐县| 竹溪县| 尼玛县| 河北省| 抚远县| 辉县市| 通城县| 木里| 紫云| 托里县| 同德县| 图片| 焉耆| 商河县| 诏安县| 茶陵县| 巴林左旗| 溆浦县| 桐柏县| 彰武县| 广宁县| 定南县| 咸阳市| 长春市| 甘孜县| 盐城市| 翁源县| 延庆县| 微山县| 西昌市| 攀枝花市| 莎车县| 灵石县| 明水县| 依安县| 灌南县|