VB6/VBA 的 LZMA 压缩?

发布于 2024-12-02 14:43:51 字数 81 浏览 1 评论 0原文

希望在我的 Access 2000 应用程序中使用 LZMA 压缩加密文件。有谁知道在 VB6/VBA 中执行此操作的最简单方法或知道任何源代码吗?

Looking to LZMA compress encrypted files in my Access 2000 application. Does anyone know the simplest way to do this in VB6/VBA or know of any source code?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

灵芸 2024-12-09 14:43:51

你说你想压缩加密文件?压缩加密文件通常不会节省太多空间,因为加密过程会扰乱压缩所处理的重复结构。所以我假设你的意思是压缩和加密文件。

有一个 7-zip lzma SDK 但你需要编译代码并工作了解如何将其转换为 Windows dll 或您可以使用的东西。

我建议您将任务推送到命令行,即

Sub test()
    Dim ProgramTaskID As Double
    ProgramTaskID = Shell("c:\compress.bat c:\source.txt c:\dest.zip", VbAppWinStyle.vbNormalFocus)
End Sub

您不需要为此创建批处理文件,您可以直接提供命令。程序启动后,Shell 函数将立即返回,因此您需要等待并测试输出文件的出现,然后再尝试对其执行任何操作。

7-zip 是免费的,并提供您可以使用的命令行语法。

You say you want to compress encrypted files? Compressing encrypted files usually doesn't result in much space saving as the encryption process scrambles the repeating structures that compression works on. So I assume you mean compress and encrypt files.

There is a 7-zip lzma SDK but you'd need to compile the code and work out how to turn it into a windows dll or something you can use.

I suggest you just push the task out to a command line i.e.

Sub test()
    Dim ProgramTaskID As Double
    ProgramTaskID = Shell("c:\compress.bat c:\source.txt c:\dest.zip", VbAppWinStyle.vbNormalFocus)
End Sub

You don't need to create a batch file for this, you could supply the command directly. The Shell function will return as soon as the program has launched, so you will need to wait and test for the output file to appear before you try and do anything with it.

7-zip is free and provides a command line syntax that you could use.

肥爪爪 2024-12-09 14:43:51

这个不是免费的,功能上可能有点过大(尽管您在问题中确实提到了加密;-):

CryptoSys - 购买

CryptoSys - 功能

也许,重要的功能之一CryptoSys的特点是它支持多种开发语言/平台,而不仅仅是VB6和VBA。

This one is not free and functionally might be an overkill (although you did mention encryption in your question ;-):

CryptoSys - Purchasing

CryptoSys - Features

Perhaps, one of the important traits of CryptoSys is that it supports several development languages/platforms, not just VB6 and VBA.

混吃等死 2024-12-09 14:43:51

与 Stepen Turner 的答案类似,您可以使用 XZ Utils 页面 中的 xz.exe(请参阅 Windows 部分)。

代码将如下所示:

Sub LzmaCompression()
    Dim ProgramTaskID As Double
    ProgramTaskID = Shell("xz.exe --format=lzma test.txt", VbAppWinStyle.vbNormalFocus)
End Sub

Similarly to Stepen Turner's answer, you could use xz.exe from the XZ Utils page (see Windows section).

The code would then look like this:

Sub LzmaCompression()
    Dim ProgramTaskID As Double
    ProgramTaskID = Shell("xz.exe --format=lzma test.txt", VbAppWinStyle.vbNormalFocus)
End Sub
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文