// make sure we have an event log
if (!(EventLog.SourceExists("Application")))
{
EventLog.CreateEventSource("Application","Application");
} if (m_eventLog == null)
{
m_eventLog = new EventLog("Application");
m_eventLog.Source = "Application";
}
// log the message
m_eventLog.WriteEntry(message, System.Diagnostics.EventLogEntryType.Error);
if (!(EventLog.SourceExists("Application")))
{
EventLog.CreateEventSource("Application","Application");
} if (m_eventLog == null)
{
m_eventLog = new EventLog("Application");
m_eventLog.Source = "Application";
}
// log the message
m_eventLog.WriteEntry(message, System.Diagnostics.EventLogEntryType.Error);
解决方案 »
- 引用类型 怎么独立操作?
- 2005中,选中某一个tab,却不会像2003那样在解决方案中自动定位到那个文件,如何实现?
- 如何从已发布的网站获得开发工具的版本(vs2003||vs2005)?
- 大灰狼呢?怎么msn阻止我了呀?
- 怎么清除缓存?
- 版主进,web下读取EXCEL文件,用OLEDB出现未指定的错误,用ODBC出现磁盘或网络错误
- 在global.asax.cs中,如何得到当前浏览的网页文件名?
- 用DataList如何实现分页!
- NHibernate中一对多级联删除问题。
- 嵌套Repeater中内层添加一两行的问题
- 谁能介绍几本asp.net的自定义控件开发的好书或者是可以下载的网站??
- 页面验证提示不出现
其实可以把日志保存到一个数据表里面的
\\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\RestrictGuestAccess to 0 (reboot)ASPNET has also no rights to create event sources. Give ASPNET account
read/write access to
\\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog (and all
sub keys)or set the userName in <processModel> in machine.config to "SYSTEM"