c# - 可以 [DllImport(“ ”)] , DLL 使用保护软件 C# Winform 后不报错
问题描述
我正在使用 C# WinForm。我有一个非托管 DLL ( nip.dll
),我把它放在同一个目录中。
使用保护软件(Obfuscator)后,这些字符不是“snip.dll”,无法导入DLL。
有什么解决办法吗?或者,我可以使用另一种语言(例如 C++)来做到这一点吗?
[DllImport(@"nip.dll", EntryPoint = "CreateInstance")]
static extern IntPtr nip_ctor(uint pID);
public nip(int pID)
{
//pInstance = nip_ctor((uint)pID);
try
{
pInstance = nip_ctor((uint)pID);
}
catch
{
MessageBox.Show("ERROR DLL");
Application.Exit();
}
}
解决方案
推荐阅读
- php - php没有将数据插入mysql数据库
- firebase - Firestore 补丁映射值 REST API
- git - Git浅克隆:只有最近X个月有活动的分支
- r - 计算每组中的观察次数
- php - jquery ajax 值到 php 变量
- json - 从 Java Swagger 模型创建 Json
- accessibility - 什么是正确的屏幕阅读器可访问标记
- java - 如何在加载/重新加载文件之前捕获 yml 解析器错误
- .net-core - 使用异步检索身份验证令牌以通过 HttpClientFactory 使用
- python - 如何在用户输入中使用 Django 过滤器的排除参数?