【发布时间】:2014-03-12 01:57:54
【问题描述】:
我正在处理一个不是我创建的 C# 项目。我把它剥离了很多。
我认为我做的一切都是正确的。它编译得很好,我可以引用 e.dll 中的 DLL。 G。 VB.NET 应用程序并使用它。
但是,DLL 的方法并未公开。
如果他看起来有什么不对劲的地方,谁能告诉我?
这是DLL的重要部分,我认为:
using System;
using System.Collections;
using System.Data;
using System.Reflection;
using System.Text;
using SevenZip.Compression.LZMA;
namespace SevenZipControl
{
public static class Zipper
{
public static bool compressBytes(byte[] InputBytes,out byte[] OutputBytes)
{
OutputBytes=SevenZipHelper.Compress(InputBytes);
return true;
}
public static bool decompressBytes(byte[] InputBytes, out byte[] OutputBytes)
{
OutputBytes = SevenZipHelper.Decompress(InputBytes);
return true;
}
}
}
这就是我在 VB.NET 中使用它的方式:
Dim c As SevenZipControl.Zipper
c. (...)
但我的函数“compressBytes”和“decompressBytes”不可用,正如在此屏幕截图中看到的那样:
【问题讨论】:
-
看起来不错,引用程序集是否具有所有必需的子引用(如 SevenZip.Compression)?尝试调用函数并构建,错误列表会告诉你是否缺少一个。
-
" DLL 的方法没有暴露" - 你是什么意思?
-
您的回答可能涉及大量猜测工作,因为您没有包含有关您如何尝试使用它的任何信息,或者如果这是您的代码,那么与 dll 无关?
-
@LordTakkera 你的意思是我需要在调用应用程序中引用 SevenZip.Compression?