asp.net+c# 菜鸟提问

菲斯可儿 2005-06-14 12:06:05
有人看过《ASP.NET Website Programming C Sharp Edition》的那个网站源码吗?我配置了半天,也没成功。
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Requested registry access is not allowed.

Source Error:


Line 29: if (!EventLog.SourceExists("ThePhile.COM"))
Line 30: {
Line 31: EventLog.CreateEventSource("ThePhile.COM", "Application");
Line 32: }
Line 33: EventLog.WriteEntry("ThePhile.COM", message, entryType);


Source File: c:\wrox\thephile\philepage.cs Line: 31

就是上面的错误,我按照fag的方法,提升了guest权限等等,还是不行,请高手帮忙。
...全文
93 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
菲斯可儿 2005-06-14
  • 打赏
  • 举报
回复
protected void LogEvent(string message, EventLogEntryType entryType)
{
if (!EventLog.SourceExists("ThePhile.COM"))
{
EventLog.CreateEventSource("ThePhile.COM", "Application");
}
EventLog.WriteEntry("ThePhile.COM", message, entryType);
}

.net我只看了一点点,基本什么都不懂,所以...
哎,郁闷啦。
triffang 2005-06-14
  • 打赏
  • 举报
回复
晕,这个例子我一配置就成功!
老戴12345654 2005-06-14
  • 打赏
  • 举报
回复
把 EventLog.CreateEventSource 代码贴出来看看
也许是这个方法里面操作某个目录或者文件,而没有权限,检查一下,添加aspnet用户权限
菲斯可儿 2005-06-14
  • 打赏
  • 举报
回复
错误依旧... ...
老戴12345654 2005-06-14
  • 打赏
  • 举报
回复
提升web目录 aspnet用户权限

62,244

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧