博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Eziriz.Net.Reactor使用注意事项
阅读量:7227 次
发布时间:2019-06-29

本文共 1273 字,大约阅读时间需要 4 分钟。

1) 保护参数配置

2) 注册表访问

 

using System.Security.Permissions;[RegistryPermissionAttribute(SecurityAction.PermitOnly, All = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Jet 4.0")]private static void UpdateOS32RegisterItem(){ 	using (RegistryKey currentKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Jet\4.0\Engines\Jet 4.0", true))	{		currentKey.SetValue("MaxLocksPerFile", 0xF4240, RegistryValueKind.DWord);		currentKey.Close();	}}

该种写法混淆后会出现如下的错误:

解决方法:

添加 应用程序清单文件,在其中加入

修改代码,如下:

private static void UpdateOS32RegisterItem() {	System.Security.Principal.WindowsIdentity identity = System.Security.Principal.WindowsIdentity.GetCurrent();	System.Security.Principal.WindowsPrincipal principal = new System.Security.Principal.WindowsPrincipal( identity );	if (principal.IsInRole(System.Security.Principal.WindowsBuiltInRole.Administrator))	{		using (RegistryKey currentKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Jet\4.0\Engines\Jet 4.0", true))		{			currentKey.SetValue("MaxLocksPerFile", 0xF4240, RegistryValueKind.DWord);			currentKey.Close();		}	} }

 

转载于:https://www.cnblogs.com/janehlp/p/5379203.html

你可能感兴趣的文章
react-hooks 实现简单的评论list
查看>>
【多图警告】学会JavaScript测试你就是同行中最亮的仔(妹)
查看>>
19-04-25
查看>>
一个JAVA程序员成长之路分享
查看>>
30K iOS程序员的简述:如何快速进阶成为高级开发人员
查看>>
Go 夜读 - 每周四晚上 Go 源码阅读技术分享
查看>>
tranform知多少
查看>>
Android电量优化
查看>>
[爬虫手记] 我是如何在3分钟内开发完一个爬虫的
查看>>
【译】Css Grid VS Flexbox: 实践比较
查看>>
iOS 开发知识索引
查看>>
Linux iptables命令
查看>>
webpack的使用
查看>>
干货 | 基于Go SDK操作京东云对象存储OSS的入门指南
查看>>
D3.js入门
查看>>
一次和前端的相互甩锅的问题记录
查看>>
纯OC实现iOS DLNA投屏功能了解一下
查看>>
RxJava -- fromArray 和 Just 以及 interval
查看>>
LC #75 JS
查看>>
js正则验证代码库
查看>>