C#中将DLL文件打包到EXE文件
1:在工程目录增加dll目录,然后将dll文件复制到此目录,例如:

2:增加引用,定位到工程的dll目录,选中要增加的dll文件

3:修改dll文件夹下面的dll文件属性

选中嵌入式资源,不复制。

4:增加dll加载代码
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{ AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
{
string resourceName = "openie01.dll" + new AssemblyName(args.Name).Name + ".dll"; using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
{
Byte[] assemblyData = new Byte[stream.Length];
stream.Read(assemblyData, , assemblyData.Length);
return Assembly.Load(assemblyData);
}
}; Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
C#中将DLL文件打包到EXE文件的更多相关文章
- 将 Python3 文件打包成 exe 文件
我们用 Python 写好的代码,如何给别人在没有配置 Python 环境的情况下直接使用呢?尤其是面向 windows 众. 因为 Python 是一门解释性的语言,离开了 Python 解释器,P ...
- 将py文件打包为exe文件方法
前提: pip是依赖python的,首先检查下windows机器上有没有安装python,或者有没有添加到环境变量中,如果都没有需要安装或者加入环境变量 安装pip 下载地址: https://pyp ...
- 将Python文件打包为exe文件,并在控制台运行之简易教程
第一步 在线安装 pyinstaller. 方法:打开win+ R,输入cmd,在命令行输入"pip install pyinstaller" 静等几分钟后即可安装成功. ...
- 将python项目.py文件打包成.exe文件
安装pyinstaller包 pip3 install pyinstaller 如果不行 pip3 install pyinstaller -i https://pypi.doubanio.com/s ...
- Pycharm下将py文件打包成exe文件
1. 在PyCharm下安装PyInstaller 1. 首先,打开自己要发布的工程 2. 点击底部的[Terminal]打开终端,中输入命令pip install pyinstaller后回车, ...
- pyinstaller相关问题 & pygame文件打包成exe文件 & 武装飞船 & 飞机大战
自己照书写了一个飞机大战游戏的python程序,想把它打包成一个exe文件,在查阅相关教程并经过数次尝试后终于成功. 安装打包应用 pyinstaller 在cmd命令窗口下pip install p ...
- 将py文件打包成exe文件
PyInstaller工具是跨平台的,它既可以在 Windows平台上使用,也可以在 Mac OS X 平台上运行.在不同的平台上使用 PyInstaller 工具的方法是一样的,它们支持的选项也是一 ...
- Python文件打包成EXE文件
工具:pyinstaller 安装:pip install pyinstaller 使用: 1 将依赖文件集中到一个文件夹: pyinstaller -D -w xxx.py ...
- [Python]项目打包:5步将py文件打包成exe文件 简介
1.下载pyinstaller并解压(可以去官网下载最新版): http://nchc.dl.sourceforge.net/project/pyinstaller/2.0/pyinstaller-2 ...
- [Python]项目打包:5步将py文件打包成exe文件(转)
1.下载pyinstaller并解压(可以去官网下载最新版): http://nchc.dl.sourceforge.net/project/pyinstaller/2.0/pyinstaller-2 ...
随机推荐
- iPhone上将短信内容发送到指定邮箱的方法
iPhone上将短信内容发送到指定邮箱的方法 迄今为止,移动应用安全基本聚焦在以下几个方面,一是移动设备管理BYOD(bring your own device),二是移动恶意软件分析,三是移动设备用 ...
- C#编程(五十一)----------链表
原文链接: http://blog.csdn.net/shanyongxu/article/details/47024865 链表 LinkedList<T>集合类没有非泛型类的版本,它是 ...
- AndroidStudio工具将Module项目导出成Jar和arr库
原文:http://blog.csdn.net/liulei823581722/article/details/52919697 该篇首先讲述利用AndroidStudio如何把一个module项目导 ...
- Cocos2d-x之Schedule
Cocos2dx的定时器 from://http://blog.linguofeng.com/archive/2012/11/14/cocos2d-x-Schedule.html 一.schedule ...
- 暴君第一季/全集Tyrant迅雷下载
本季第一季 Tyrant Season 1 (2014)看点:虽然李安退出了FX系列剧<暴君>(Tyrant),称不想耽误了剧集的制作,但显然FX对这部剧的重视程度非比寻常,因为他们找来的 ...
- nodejs ffi(DLL)
npm install ffi Error: The specified module could not be found. npm rebuild var ffi = require('ffi') ...
- android BitmapDrawable的使用
<span style="font-size:18px;"> //功能:显示缩略图,大小为40*40 //通过openRawResource获取一个inputStrea ...
- Java之旅--定时任务(Timer、Quartz、Spring、LinuxCron)
在Java中,实现定时任务有多种方式,本文介绍4种,Timer和TimerTask.Spring.QuartZ.Linux Cron. 以上4种实现定时任务的方式,Timer是最简单的,不需要任何框架 ...
- PHP xhprof性能优化
xhprof window http://dev.freshsite.pl/php-extensions/xhprof.html http://php.net/manual/en/book.xhpro ...
- glyphicons-halflings-regular.woff2:1 Failed to load resource: the server responded with a status of 404 (Not Found)解决Web部署 svg/woff/woff2字体 404错误
问题:最近在IIS上部署web项目的时候,发现浏览器总是报找不到woff.woff2字体的错误.导致浏览器加载字体报404错误,白白消耗了100-200毫秒的加载时间. 原因:因为服务器IIS不认SV ...