用PetShop改了个网站,不过程序一出现错误的时候就保“注册表无法访问”的错,
------------------------------------------------------------------------
{
    EventLog m_enentLog=null;
行 14:    if(!(EventLog.SourceExists(ERROR_LOG_SOURCE)))
行 15:    {
行 16:     EventLog.CreateEventSource(ERROR_LOG_SOURCE, "Application");
------------------------------------------------------------------------
原来PetShop中的错误是要写到操作系统日志中的,在Erro.cs中:
PetShop中报错的处理(EventLog.SourceExists的使用)问题public class Error
解决方法:
在注册表
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application
加入:项“comeday”(你的应用程序名称,我的是comeday)就OK了。

相关文章:

  • 2022-01-30
  • 2021-09-13
  • 2021-09-23
  • 2021-05-20
  • 2021-09-13
  • 2022-12-23
  • 2022-12-23
  • 2021-09-23
猜你喜欢
  • 2021-06-14
  • 2021-07-18
  • 2021-07-21
  • 2022-12-23
  • 2021-12-04
  • 2021-12-22
  • 2022-12-23
相关资源
相似解决方案