将dll合并为vb net project的可执行文件 [英] Merge dll to vb net project's executable

查看:117
本文介绍了将dll合并为vb net project的可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我有这个代码:

Hello,
I have this code :

Dim TargetProcess As Process() = Process.GetProcessesByName(TextBox2.Text)
           TargetProcessHandle = OpenProcess(PROCESS_CREATE_THREAD Or PROCESS_VM_OPERATION Or PROCESS_VM_WRITE, False, TargetProcess(0).Id)
           pfnStartAddr = GetProcAddress(GetModuleHandle("Kernel32"), "LoadLibraryA")
           TargetBufferSize = 1 + Len(TextBox1.Text)
           Dim Rtn As Integer
           Dim LoadLibParamAdr As Integer
           LoadLibParamAdr = VirtualAllocEx(TargetProcessHandle, 0, TargetBufferSize, MEM_COMMIT, PAGE_READWRITE)
           Rtn = WriteProcessMemory(TargetProcessHandle, LoadLibParamAdr, TextBox1.Text, TargetBufferSize, 0)
           CreateRemoteThread(TargetProcessHandle, 0, 0, pfnStartAddr, LoadLibParamAdr, 0, 0)
           CloseHandle(TargetProcessHandle)



textbox1包含dll文件的路径,我想问一下如何调用dll并在代码中使用它并将其与项目的可执行文件合并,我听说过ilmerge但是我想从项目中调用dll并且在项目的exe内部也有它。如何在Project可执行文件中合并rhe dll并在代码中使用它?



我尝试过:



我从项目和工程外部打电话。


textbox1 contains the path to a dll file, I want to ask how can I call the dll and use it in the code and have it merged with the project's executable, I heard of ilmerge but I want to call the dll from inside the Project and also have it internally in the project's exe. How to merge rhe dll in the Project executable and also use it inside the code?

What I have tried:

I call from outside the Project and Works.

推荐答案

你只能用.NET程序集.DLL来做,使用ILMerge。没有其他类型的.DLL可以合并到您的可执行文件中。
You can only do that with .NET assembly .DLL's, using ILMerge. No other types of .DLL's can be merged into your executable.


这篇关于将dll合并为vb net project的可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆