在运行的方法里面 加try 捕捉一下 看有没有很忙异常···
解决方案 »
- 如何快速的用C#做系统?
- Directory.getfiles()的权限,搜索问题
- c# 读EXCELL 表格问题(有空值)
- .NET打印
- 怎样写才能让windows服务,弹出窗体
- C# 的控制台程序最多可使用几个定时器
- 高手帮忙看一下这段代码
- 请问Winform有没WebForm的GridView一样的模板功能?纠结一天,路过走过的也水下吧
- 用C#写一个应用程序调用ASP.NET页面,将ASP.NET页面上的数据不停的读入到数据库中(紧急求救!)
- 在IE web control中,如何屏蔽鼠标右键菜单?
- Webbrowser模拟操作淘宝后台批量收货功能
- 用Vs2008如何连接Mysql数据库
问题签名:
问题事件名称: CLR20r3
问题签名 01: genxin.exe
问题签名 02: 1.0.0.0
问题签名 03: 540ed810
问题签名 04: mscorlib
问题签名 05: 4.0.30319.18444
问题签名 06: 52717edc
问题签名 07: 36f
问题签名 08: 18
问题签名 09: System.ArgumentOutOfRange
OS 版本: 6.1.7601.2.1.0.274.10
区域设置 ID: 2052
其他信息 1: 0a9e
其他信息 2: 0a9e372d3b4ad19135b953a78882e789
其他信息 3: 0a9e
其他信息 4: 0a9e372d3b4ad19135b953a78882e789
研究了一下午,是这样做吗?using System;
using System.Threading;
using System.Windows.Forms;namespace genxin
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
//Application.EnableVisualStyles();
//Application.SetCompatibleTextRenderingDefault(false);
//Application.Run(new Form1()); Application.ThreadException += new ThreadExceptionEventHandler(MainUIThreadExceptionHandler);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(MainUIUnhandledExceptionHandler); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
} public static void MainUIThreadExceptionHandler(object sender, ThreadExceptionEventArgs e)
{
MessageBox.Show(e.Exception.Message, "线程异常:", MessageBoxButtons.OK, MessageBoxIcon.Error);
} public static void MainUIUnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs e)
{
MessageBox.Show(e.ExceptionObject.ToString(), "未处理的异常:", MessageBoxButtons.OK, MessageBoxIcon.Error);
} }
}