惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Security @ Cisco Blogs
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tenable Blog
C
CERT Recently Published Vulnerability Notes
T
Threatpost
C
Cisco Blogs
Know Your Adversary
Know Your Adversary
T
Tor Project blog
博客园 - 司徒正美
有赞技术团队
有赞技术团队
T
Tailwind CSS Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
宝玉的分享
宝玉的分享
博客园 - 三生石上(FineUI控件)
L
LangChain Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Stack Overflow Blog
Stack Overflow Blog
Microsoft Security Blog
Microsoft Security Blog
AWS News Blog
AWS News Blog
人人都是产品经理
人人都是产品经理
P
Proofpoint News Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
A
Arctic Wolf
L
LINUX DO - 热门话题
C
Cyber Attacks, Cyber Crime and Cyber Security
爱范儿
爱范儿
美团技术团队
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Hugging Face - Blog
Hugging Face - Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
C
CXSECURITY Database RSS Feed - CXSecurity.com
P
Privacy International News Feed
PCI Perspectives
PCI Perspectives
H
Heimdal Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
F
Full Disclosure
SecWiki News
SecWiki News
T
The Blog of Author Tim Ferriss
Help Net Security
Help Net Security
Google DeepMind News
Google DeepMind News
P
Palo Alto Networks Blog
博客园 - 叶小钗
C
Check Point Blog
Scott Helme
Scott Helme
V
Visual Studio Blog
博客园 - 聂微东
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Google Online Security Blog
Google Online Security Blog
大猫的无限游戏
大猫的无限游戏
The Register - Security
The Register - Security

博客园 - zqstc

The following module was built either with optimizations enabled or witherout debug information QQQQQQQ sql 2005 分页 Java学习路线图 SQL 链接服务器及权限限制 apache与tomcat整合 eclipse学习 Eclipse3.6版本汉化 Eclipse 的版本历史 MOSS2007下载 MOSS安装全过程 SQL简繁体转换 SQL2000 递归问题 Tomcat+JSP学习一 JavaScript---radio组 Office2003关联的word文档图标无法显示解决方案 用于主题检测的临时日志(f328f8e5-34df-4189-bccc-47d1025dc7dd - 3bfe001a-32de-4114-a6b4-4005b770f6d7) wa gaga SQL学习 continue~~
Requested registry access is not allowed(不允许所请求的注册表访问权)
zqstc · 2010-04-07 · via 博客园 - zqstc

尝试创建自定义事件日志时,将会收到“Requested registry access is not allowed(不允许所请求的注册表访问权)”错误消息

EventLog.CreateEventSource()

如果以普通用户身份登录计算机,并尝试使用 Microsoft Visual Studio .NET 创建自定义事件日志以注册事件,可能会收到以下错误消息:

An unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib.dll
Additional information:Requested registry access is not allowed.

出现此问题的原因在于登录所用的用户帐户没有足够的权限。
首次调用 EventLog.CreateEventSource() 方法创建自定义事件日志时,将会在下面的注册表子项下创建自定义事件日志条目:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog

要创建此子项条目,必须拥有写权限。但是,普通用户帐户没有写权限。因此,会收到“症状”部分中提到的错误消息。

警告:如果使用注册表编辑器或其他方法错误地修改了注册表,则可能导致严重问题。这些问题可能需要重新安装操作系统才能解决。Microsoft 不能保证可以解决这些问题。修改注册表需要您自担风险。
要解决此问题,请使用下列方法之一:

  • 授予创建自定义事件日志的权限
  • 以管理员身份安装自定义事件日志
授予创建自定义事件日志的权限
  1. 以管理员身份登录计算机。
  2. 依次单击“开始”和“运行”,在“打开”框中键入 regedit,然后单击“确定”。这将打开“注册表编辑器”窗口。
  3. 找到以下注册表子项:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog

  4. 右键单击“Eventlog”,然后单击“权限”。这将显示“Eventlog 的权限”对话框。
  5. 单击“高级”。此时显示“Eventlog 的高级安全设置”对话框。
  6. 在“名称”列中,双击“Users”组。这将显示“Eventlog 的权限项目”对话框。
  7. 依次选中“设置数值”和“创建子项”复选框,然后单击“确定”。
  8. 退出注册表编辑器,然后从管理员帐户中注销。
  9. 以普通用户身份登录计算机。
  10. 尝试使用 Visual Studio .NET 创建自定义事件日志,然后尝试使用基于 Visual Studio .NET 构建的应用程序写入此事件日志。
以管理员身份安装自定义事件日志
  1. 以管理员身份登录计算机。
  2. 使用 Visual Studio .NET 中的 CreateEventSource 方法创建自定义事件日志和事件日志源。
  3. 从管理员帐户注销。
  4. 以普通用户身份登录计算机。
  5. 通过运行应用程序将条目写入自定义事件日志。

来源:http://support.microsoft.com/kb/842795/zh-cn