安全性异常 
说明: 应用程序试图执行安全策略不允许的操作。要授予此应用程序所需的权限,请与系统管理员联系,或在配置文件中更改该应用程序的信任级别。 异常详细信息: System.Security.SecurityException: 不允许所请求的注册表访问权。源错误: 
行 261: if (!EventLog.SourceExists("hotop100"))
行 262: {
行 263: EventLog.CreateEventSource("hotop100", "Application");
行 264: }
行 265: //将错误日志信息写入Windows事件日志中
 源文件: C:\Inetpub\wwwroot\hotop100oa\PageBase.cs    行: 263 堆栈跟踪: 
[SecurityException: 不允许所请求的注册表访问权。]
   Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +473
   System.Diagnostics.EventLog.CreateEventSource(String source, String logName, String machineName, Boolean useMutex) +443
   System.Diagnostics.EventLog.CreateEventSource(String source, String logName, String machineName) +10
   System.Diagnostics.EventLog.CreateEventSource(String source, String logName) +11
   qminoa.Webs.PageBase.LogEvent(String message, EventLogEntryType entryType) in C:\Inetpub\wwwroot\hotop100oa\PageBase.cs:263
   qminoa.Webs.PageBase.PageBase_Error(Object sender, EventArgs e) in C:\Inetpub\wwwroot\hotop100oa\PageBase.cs:286
   System.Web.UI.TemplateControl.OnError(EventArgs e) +109
   System.Web.UI.Page.HandleError(Exception e) +68
   System.Web.UI.Page.ProcessRequestMain() +2100
   System.Web.UI.Page.ProcessRequest() +217
   System.Web.UI.Page.ProcessRequest(HttpContext context) +18
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:1.1.4322.2032; ASP.NET 版本:1.1.4322.2032 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
那位能帮忙提示一下?

解决方案 »

  1.   

    是权限问题,给asp.net用户加权限
      

  2.   

    对服务器的注册表的访问或改写?汗。
    倒是对文件,或对OFFICE等的权限经常见。
    不知道楼主实现的是什么功能? :)
      

  3.   

    把aspnet用户加入到administrator组中就可以了
      

  4.   

    因为系统日志的操作是有权限控制的,所以我们还要把对系统日志操作的权限赋给asp.net用户,方法如下:“开始->运行”,输入命令,“regedt32”,找到“System->CurrentControlSet->Services->Eventlog”,选择“安全->权限->添加”,然后找到本机的“AspNet”用户,加进来并且给读取权限就好了,加进来后目录中会多一个“aspnet_wp account”
      

  5.   

    up
    我也遇到同样的的问题!请教高手!而且我已经将aspnet用户加入到ADMINISTATOR中了