小弟最近正在做一个项目的Bug提交!现在需要把捕获到的异常存储下来!
winform中捕获异常,并把该异常的原因,方法名称(发生异常的方法全名称),参数值存入xml中

解决方案 »

  1.   

    AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);   void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
            {
                Exception error = e.ExceptionObject as Exception;
                string message = error.Message;
                string source = error.Source;
                string stackTrace = error.StackTrace;
    //保存成xml格式
            }
      

  2.   

    我现在可以存储了,那怎样来判断整个项目第一次调用该方法!
    也就是说:我想在第一次发生异常的时候捕获到用户的计算机工作环境
    如:ie版本号,操作系统,已经 .net版本等信息呢?
    分不够可以加!
      

  3.   

    你直接写一个方法去存储发生异常的原因等等信息!
    然后写入xml,当存到一定时间了,你就可以利用webservice发送到服务器了!