C# 应用程序停止工作 [英] C# application stopped working

查看:134
本文介绍了C# 应用程序停止工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Visual c# express 2008 中制作了一个 C# windows 应用程序.我在我的 PC 上单独执行了 exe 文件,它运行得很好.".在我的电脑上,它也会在 5-10 分钟后停止工作.那么是我的代码有问题还是其他什么问题?

I made a C# windows application in visual c# express 2008. I executed the exe file seperately on my PC and it worked perfectly.. Now when I ran the same file on another computer having vista an error occurred "WindowsFormapplication has stopped working". On my computer too it stops working after 5-10 min. So is the problem with my code or is it anything else?

我是这里的新手...任何帮助将不胜感激..

I am a newbie here... Any help would be appreciated..

已编辑.....

它使用定时器:

System.Timers.Timer timer = new System.Timers.Timer();
timer.Elapsed += new ElapsedEventHandler(startup.onTimerEvent);
timer.AutoReset = true;
timer.Interval = 60000;
timer.Start();
Application.Run();
GC.KeepAlive(timer);

它还创建并设置了一个注册表项..

It also creates and sets a registry key..

推荐答案

我猜是权限问题.在 Vista 上,系统被锁定得更紧,因此如果您的程序无法获得所需的权限,它将抛出异常.如果这种情况发生在程序开始时,这就是您在启动时收到错误的原因.

I'm guessing it is a permissions issue. On Vista the system is locked down tighter so if your program couldn't get the permission it needed it will throw an exception. If that happens at the start of the program that's why you get the error on start up.

在您自己的机器上,您可能需要等待 5-10 分钟,因为它是导致应用程序失败的另一个错误.

On your own machine you may be waiting 5-10 minutes because it is a different bug that is causing the application to fail.

这篇关于C# 应用程序停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆