网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

当访问EventLog时,抛出SecurityException

当调用EventLog.SourceExists("source1")时,抛出一下异常

成都创新互联专注为客户提供全方位的互联网综合服务,包含不限于成都网站设计、网站建设、枣阳网络推广、微信小程序开发、枣阳网络营销、枣阳企业策划、枣阳品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们最大的嘉奖;成都创新互联为所有大学生创业者提供枣阳建站搭建服务,24小时服务热线:028-86922220,官方网址:www.cdcxhl.com

System.Security.SecurityException was unhandled
  HResult=-2146233078
  Message=The source was not found, but some or all event logs could not be searched.  Inaccessible logs: Security.
  Source=System
  StackTrace:
       at System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly, Boolean wantToCreate)
       at System.Diagnostics.EventLog.SourceExists(String source, String machineName, Boolean wantToCreate)
       at System.Diagnostics.EventLog.SourceExists(String source)
       at EventLogApp.Program.Main(String[] args) in E:\MyWorkspace\Projects\Tuturial\CSharpStudy\EventLogApp\Program.cs:line 14
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:

解决方案:

右键点击要运行的文件,执行“run as administrator‘

Creating event log sources without administrative rights

http://www.neovolve.com/post/2008/11/12/Creating-event-log-sources-without-administrative-rights.aspx


标题名称:当访问EventLog时,抛出SecurityException
链接URL:http://bjjierui.cn/article/gscgch.html

其他资讯