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();
}
}

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

解决方法:

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

<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC 清单选项
如果希望更改 Windows 用户帐户控制级别,请用以下节点之一替换
requestedExecutionLevel 节点。 <requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" /> 如果您希望利用文件和注册表虚拟化提供
向后兼容性,请删除 requestedExecutionLevel 节点。
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
</asmv1:assembly>

修改代码,如下:

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();
}
}
}

Eziriz.Net.Reactor使用注意事项的更多相关文章

  1. [转载]Eziriz .NET Reactor 4.7.0.0 官方原版+破解补丁(强大的代码保护和软件防盗版工具)

    Eziriz .NET Reactor 是一个强大的代码保护和软件防盗版工具,完全由.NET框架编写..NET Reactor支持NET平台的软件许可系统,并支持NET程序集所有语言.当.Net编译器 ...

  2. net reactor加密源码保软件安全-net reactor使用教程

    上一次介绍用 Xenocode Postbuild for .NET 混淆加密源代码确保软件安全,本篇将讨论用 Eziriz .NET Reactor 混淆加密软件源代码,为从未用过该软件加密的用户分 ...

  3. .NET Reactor 命令行使用

    安装.NET Reactor工具软件.例如你的安装目录为:D:\Program Files\Eziriz\.NET Reactor 按如下步骤设置系统环境变量path. 将path变量的值中加入.NE ...

  4. [转].net reactor 学习系列(五)---源代码加密程序

    .NET Reactor使用教程(加密源代码示例) 1.打开 Eziriz .NET Reactor,主界面如图1所示: 图1 2.单击 Main Assembly 右边的 Open,选择要加密的软件 ...

  5. .NET Reactor使用教程(加密源代码示例)

    更多:https://www.cnblogs.com/PiaoMiaoGongZi/category/1120300.html 1.打开 Eziriz .NET Reactor,主界面如图1所示: 图 ...

  6. 软件License设计

    如何保护软件版权,最常用的办法就是设计一套license验证框架. 1.我们的常规需求如下: .可以限制软件只能在一台机器上使用: 目前很多软件都是一机一码的销售,软件换一台机器则不能使用,想要几台机 ...

  7. c++调用c#代码

    // ConsoleApplication1.cpp : 此文件包含 "main" 函数.程序执行将在此处开始并结束. // #include "pch.h" ...

  8. .net refactor 命令行

    VS中设置项目的编译后事件命令(此命令会在程序集生成后自动在原位置加密,覆盖原来的程序集): "C:\Program Files (x86)\Eziriz\.NET Reactor\dotN ...

  9. 使用.NET REACTOR制作软件许可证

    原文:使用.NET REACTOR制作软件许可证 软件下载地址:http://www.eziriz.com/downloads.htm 做一个简单的许可证系统,下面是具体步骤: 1,  OPEN AS ...

随机推荐

  1. android学习--radiogroup学习

    这个阶段在学习android的相关基本UI现将相关练习的代码粘贴在此便于后期学习之用(radio控件) 效果图:   main_layout.xml <?xml version="1. ...

  2. tomcat console

    1.大家都知道,在Tomcat5及其以后的版本中,当启动tomcat之后,是看不到控制台中的manager应用的.Manager的应用还是很有好处的,可以直接在控制台上(类似于weblogic上的co ...

  3. SinoSure

    Sino,就是“中国.东方”的意思, 这个词只能作为前缀使用,不能单独讲.西方社会有时使用“Sino-”来表示“中国(的)”的意思,但是“Sino”均为连接词,并非单独用来表示“中国”之语.如表达中美 ...

  4. Java-对象数组排序

    1.对对象数组排序:对象要提供一个compare方法比较对象的大小 2.代码 package Test; public class TestObjectArray { public static vo ...

  5. php curl getinfo

    <?php    $ch = curl_init("http://www.baidu.com/"); echo "<pre>";print_r ...

  6. HTML5的fieldset标签

    定义和用法 fieldset 元素可将表单内的相关元素分组,绘制一个带标题的框,有如winform开发中的panel. <fieldset> 标签将表单内容的一部分打包,生成一组相关表单的 ...

  7. DB2中字符、数字和日期类型之间的转换

    DB2中字符.数字和日期类型之间的转换 一般我们在使用DB2或Oracle的过程中,经常会在数字<->字符<->日期三种类 型之间做转换,那么在DB2和Oracle中,他们分别 ...

  8. libevent系列文章

    Libevent 2 提供了 bufferevent 接口,简化了编程的难度,bufferevent 实际上是对底层事件核心的封装,因此学习 bufferevent 的实现是研究 Libevent 底 ...

  9. linux select

    man select: #include <sys/select.h> #include <sys/time.h> int select(int nfds, fd_set *r ...

  10. PHP 简介

    lamp LAMP - Linux Apache MySQL PHP MySQL - 三个层次:文件层次,服务层次,界面层次. LAMP-Linux Apache MySQL PHP 本机 :127. ...