c# - 从使用 Excel-DNA 构建的 Excel .XLL 文件中解压内容

标签 c# excel unpack xll excel-dna

不知道大家是否知道excel-dna项目,这是一个帮助将.net汇编和语言集成到excel addins中的项目。

我的问题是我想从 xll 文件中解压一个 dll(excel-dna 能够将资源打包到 xll 中)。

我下载了 excel-dna 源并且已经在源代码的基础上编写了这个:

string xlllib = @"C:\pathtomyxllfile\myaddin.xll";
string xlloutput = @"C:\pathtomyxllfile\myaddin.dll";
var hModule = ResourceHelper.LoadLibrary(xlllib);
var content = ResourceHelper.LoadResourceBytes(hModule, "ASSEMBLY_LZMA", "MYASSEMBLYNAME");

using (BinaryWriter binWriter = new BinaryWriter(File.Open(xlloutput, FileMode.Create)))
        {
            binWriter.Write(content);
        }

但它不起作用。 任何人有从 xll 解压 dll 的想法吗?

提前致谢,

最佳答案

如果您希望从 Excel-DNA 加载项中提取 .NET 程序集,我编写了一个名为 ExcelDnaUnpack 的小实用程序。 。源代码在 GitHub 上:https://github.com/augustoproiete/exceldna-unpack

ExcelDna-Unpack is a command-line utility to extract the contents of ExcelDna add-ins packed with ExcelDnaPack

ExcelDna-Unpack

Usage: ExcelDna-Unpack.exe [<options>]

Where [<options>] is any of:

--xllFile=VALUE    The XLL file to be unpacked; e.g. MyAddIn-packed.xll
--outFolder=VALUE  [Optional] The folder into which the extracted files will be written; defaults to '.\unpacked'
--overwrite        [Optional] Allow existing files of the same name to be overwritten

Example: ExcelDna-Unpack.exe --xllFile=MyAddIns\FirstAddin-packed.xll
         The extracted files will be saved to MyAddIns\unpacked

关于c# - 从使用 Excel-DNA 构建的 Excel .XLL 文件中解压内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7402209/

相关文章:

c# - Excel Interop - 保护工作表不包括列

vba - 我怎样才能得到平均每小时不包括 10+ 分钟的差异

ruby - 如何将 64 位二进制字符串转换为 ruby​​ 中的双 float ?

c# - 日期时间格式到 YYYY-mm-dd 转换 c# asp.net

c# - 如何在 View 页面中显示两个不同的列表?

c# - 如何给静态名称以将 JavaScript 文件作为资源嵌入到 asp.net 中

c# - 通过 Windows 窗体发送用户输入

php - 在codeigniter中将excel数据导入数据库

Perl 打包/解包/移位

适用于 iOS 的 JavaScript 解包库