C#程序运行一段时间后自动退出

gang41266 2016-07-25 06:36:36
我之前写的一个C#程序在做一个功能之后,开启功能运行一段时间(一两天)后就会自动停止,后来查看系统日志也没发现什么原因,求各位大神帮忙看一看。
下面是最近几天的系统日志。
错误模块名称: KERNELBASE.dll,版本: 6.1.7601.18409,时间戳: 0x531599f6
异常代码: 0xe0434352
错误偏移量: 0x0000812f
错误进程 ID: 0x%9
错误应用程序启动时间: 0x%10
错误应用程序路径: %11
错误模块路径: %12
报告 ID: %13"
错误 2016/7/23 11:17:29 .NET Runtime 1026 无 Application: UI.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentException
Stack:
at System.Drawing.Bitmap..ctor(Int32, Int32, System.Drawing.Imaging.PixelFormat)
at ClassLibrary2.Class1.PHeadData()
at ClassLibrary2.Class1.thread_print()
at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()

错误 2016/7/23 7:02:30 Application Error 1000 (100) "错误应用程序名称: UI.exe,版本: 1.0.0.4,时间戳: 0x57908c8a
错误模块名称: KERNELBASE.dll,版本: 6.1.7601.18409,时间戳: 0x531599f6
异常代码: 0xe0434352
错误偏移量: 0x0000812f
错误进程 ID: 0x%9
错误应用程序启动时间: 0x%10
错误应用程序路径: %11
错误模块路径: %12
报告 ID: %13"
错误 2016/7/23 7:02:30 .NET Runtime 1026 无 Application: UI.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentException
Stack:
at System.Drawing.Bitmap..ctor(Int32, Int32, System.Drawing.Imaging.PixelFormat)
at ClassLibrary2.Class1.PHeadData()
at ClassLibrary2.Class1.thread_print()
at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()

错误 2016/7/23 2:37:39 Application Error 1000 (100) "错误应用程序名称: UI.exe,版本: 1.0.0.4,时间戳: 0x57908c8a
错误模块名称: KERNELBASE.dll,版本: 6.1.7601.18409,时间戳: 0x531599f6
异常代码: 0xe0434352
错误偏移量: 0x0000812f
错误进程 ID: 0x%9
错误应用程序启动时间: 0x%10
错误应用程序路径: %11
错误模块路径: %12
报告 ID: %13"
错误 2016/7/23 2:37:38 .NET Runtime 1026 无 Application: UI.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentException
Stack:
at System.Drawing.Bitmap..ctor(Int32, Int32, System.Drawing.Imaging.PixelFormat)
at ClassLibrary2.Class1.PHeadData()
at ClassLibrary2.Class1.thread_print()
at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()

错误 2016/7/22 22:01:30 Microsoft-Windows-WMI 10 无 "Event filter with query ""SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA ""Win32_Processor"" AND TargetInstance.LoadPercentage > 99"" could not be reactivated in namespace ""//./root/CIMV2"" because of error 0x80041003. Events cannot be delivered through this filter until the problem is corrected."
错误 2016/7/22 13:13:02 Microsoft-Windows-WMI 10 无 "Event filter with query ""SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA ""Win32_Processor"" AND TargetInstance.LoadPercentage > 99"" could not be reactivated in namespace ""//./root/CIMV2"" because of error 0x80041003. Events cannot be delivered through this filter until the problem is corrected."
错误 2016/7/22 11:39:04 Microsoft-Windows-WMI 10 无 "Event filter with query ""SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA ""Win32_Processor"" AND TargetInstance.LoadPercentage > 99"" could not be reactivated in namespace ""//./root/CIMV2"" because of error 0x80041003. Events cannot be delivered through this filter until the problem is corrected."
错误 2016/7/21 22:05:51 Microsoft-Windows-WMI 10 无 "Event filter with query ""SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA ""Win32_Processor"" AND TargetInstance.LoadPercentage > 99"" could not be reactivated in namespace ""//./root/CIMV2"" because of error 0x80041003. Events cannot be delivered through this filter until the problem is corrected."
错误 2016/7/21 16:27:35 Application Hang 1002 (101) "程序 UI.exe 版本 1.0.0.4 停止与 Windows 交互并已关闭。若要查看是否有关于该问题的详细信息,请检查“操作中心”控制面板中的问题历史记录。
进程 ID: 868
开始时间: 01d1e325dc92e188
终止时间: 47
应用程序路径: C:\Users\Administrator\Desktop\Debug\UI.exe
报告 ID: f7436e13-4f1c-11e6-a6f5-08606ef98222
"
错误 2016/7/21 14:43:08 Application Error 1000 (100) "错误应用程序名称: UI.exe,版本: 1.0.0.4,时间戳: 0x5790694e
错误模块名称: KERNEL32.dll,版本: 6.1.7601.18409,时间戳: 0x531599f5
异常代码: 0xc0000005
错误偏移量: 0x0004ccbd
错误进程 ID: 0x4f0
错误应用程序启动时间: 0x01d1e31afb28973a
错误应用程序路径: C:\Users\Administrator\Desktop\Debug\UI.exe
错误模块路径: C:\Windows\system32\KERNEL32.dll
报告 ID: 6200fb2d-4f0e-11e6-a6f5-08606ef98222"
错误 2016/7/21 14:43:03 Application Error 1000 (100) "错误应用程序名称: UI.exe,版本: 1.0.0.4,时间戳: 0x5790694e
错误模块名称: KERNELBASE.dll,版本: 6.1.7601.18409,时间戳: 0x531599f6
异常代码: 0xc0020001
错误偏移量: 0x0000812f
错误进程 ID: 0x4f0
错误应用程序启动时间: 0x01d1e31afb28973a
错误应用程序路径: C:\Users\Administrator\Desktop\Debug\UI.exe
错误模块路径: C:\Windows\system32\KERNELBASE.dll
报告 ID: 5f2171f8-4f0e-11e6-a6f5-08606ef98222"
警告 2016/7/21 14:37:41 Microsoft-Windows-CAPI2 4102 无 达到 50 事件的 crypt32 阈值,将暂停记录 60 分钟。
错误 2016/7/21 14:35:19 Microsoft-Windows-WMI 10 无 "Event filter with query ""SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA ""Win32_Processor"" AND TargetInstance.LoadPercentage > 99"" could not be reactivated in namespace ""//./root/CIMV2"" because of error 0x80041003. Events cannot be delivered through this filter until the problem is corrected."
错误 2016/7/21 13:19:34 Application Error 1000 (100) "错误应用程序名称: UI.exe,版本: 1.0.0.4,时间戳: 0x5788356b
错误模块名称: KERNELBASE.dll,版本: 6.1.7601.18409,时间戳: 0x531599f6
异常代码: 0xe0434352
错误偏移量: 0x0000812f
错误进程 ID: 0xaa8
错误应用程序启动时间: 0x01d1e2eeb0c5c585
错误应用程序路径: C:\A03喷码系统\UI.exe
错误模块路径: C:\Windows\system32\KERNELBASE.dll
报告 ID: b5864508-4f02-11e6-af08-08606ef98222"
错误 2016/7/21 13:17:52 Application Error 1000 (100) "错误应用程序名称: UI.exe,版本: 1.0.0.4,时间戳: 0x5788356b
错误模块名称: KERNELBASE.dll,版本: 6.1.7601.18409,时间戳: 0x531599f6
异常代码: 0xe0434352
错误偏移量: 0x0000812f
错误进程 ID: 0x%9
错误应用程序启动时间: 0x%10
错误应用程序路径: %11
错误模块路径: %12
报告 ID: %13"
错误 2016/7/21 13:17:52 .NET Runtime 1026 无 Application: UI.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentException
Stack:
at System.Drawing.Bitmap..ctor(Int32, Int32, System.Drawing.Imaging.PixelFormat)
at ClassLibrary2.Class1.PHeadData()
at ClassLibrary2.Class1.thread_print()
at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()

错误 2016/7/21 9:23:32 Application Error 1000 (100) "错误应用程序名称: UI.exe,版本: 1.0.0.4,时间戳: 0x5788356b
错误模块名称: KERNELBASE.dll,版本: 6.1.7601.18409,时间戳: 0x531599f6
异常代码: 0xe0434352
错误偏移量: 0x0000812f
错误进程 ID: 0x%9
错误应用程序启动时间: 0x%10
错误应用程序路径: %11
错误模块路径: %12
报告 ID: %13"
错误 2016/7/21 9:23:32 .NET Runtime 1026 无 Application: UI.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentException
Stack:
at System.Drawing.Bitmap..ctor(Int32, Int32, System.Drawing.Imaging.PixelFormat)
at ClassLibrary2.Class1.PHeadData()
at ClassLibrary2.Class1.thread_print()
at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()

错误 2016/7/21 5:04:27 Application Error 1000 (100) "错误应用程序名称: UI.exe,版本: 1.0.0.4,时间戳: 0x5788356b
错误模块名称: KERNELBASE.dll,版本: 6.1.7601.18409,时间戳: 0x531599f6
异常代码: 0xe0434352
错误偏移量: 0x0000812f
错误进程 ID: 0x%9
错误应用程序启动时间: 0x%10
错误应用程序路径: %11
错误模块路径: %12
报告 ID: %13"
错误 2016/7/21 5:04:27 .NET Runtime 1026 无 Application: UI.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentException
Stack:

...全文
1842 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
秋的红果实 2016-07-26
  • 打赏
  • 举报
回复
引用 2 楼 gang41266 的回复:
[quote=引用 1 楼 From_TaiWan 的回复:] 快崩溃时,检查下内存是不是跑满了; 还有,是不是数据库、文件快满了(磁盘小的情况) 检查下Class1.PHeadData(),Class1.thread_print()
我不知道什么时候崩溃的,有时候用三个小时崩溃,有时候六个小时崩溃[/quote]不一定在正好崩溃时查看,比如三小时查看,要是五小时崩溃,那么三小时就可以看到了 我总结了下你贴出的错误信息,貌似就是我说的。再查下是不是有些非托管资源没有及时释放,如sqlconnection,stream,filestream等等
gang41266 2016-07-26
  • 打赏
  • 举报
回复
引用 1 楼 From_TaiWan 的回复:
快崩溃时,检查下内存是不是跑满了; 还有,是不是数据库、文件快满了(磁盘小的情况) 检查下Class1.PHeadData(),Class1.thread_print()
我不知道什么时候崩溃的,有时候用三个小时崩溃,有时候六个小时崩溃
秋的红果实 2016-07-25
  • 打赏
  • 举报
回复
快崩溃时,检查下内存是不是跑满了; 还有,是不是数据库、文件快满了(磁盘小的情况) 检查下Class1.PHeadData(),Class1.thread_print()

110,499

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧