【问题标题】:Uuencode / Uudecode library for .NET or for Visual C++ 6.0?.NET 或 Visual C++ 6.0 的 Uuencode / Uudecode 库?
【发布时间】:2010-10-27 03:34:35
【问题描述】:

我有一些 uuencoded 文件,我需要使用 .NET 2.0 或 Visual C++ 6.0 对它们进行解码。有什么好的库/类可以帮助到这里吗?看起来这不是 .NET 或 MFC 中内置的。

【问题讨论】:

    标签: .net visual-c++


    【解决方案1】:

    试试 uudeview,here。它是一个运行良好的开源库,除了 uuencoded 文件之外,它还将处理日元文件。您可以将它与 C/C++ 一起使用,或者为 C# 编写互操作包装器,而不会有太多麻烦。

    【讨论】:

    • 澄清一下,这是 C 代码。此外,作者似乎非常认真地对待 UUEncoding 和编写/记录他的库。
    【解决方案2】:

    Code Project 有一个 .NET 库 + 用于 uuencoding/decoding 的源代码。实际的算法本身在网络上传播得相当广泛,而且很短。

    代码项目链接:http://www.codeproject.com/KB/security/TextCoDec.aspx

    文章简介:

    本文介绍了一个类库 用于编码/解码文件和/或 .NET 中几种算法中的文本。 这个库的一些特性:

    在 Quoted 中编码/解码文本 可打印的编码/解码文件和 Base64 编码/解码文件中的文本 和 UUEncode 编码/解码中的文本 yEnc 中的文件

    【讨论】:

      【解决方案3】:

      我知道这是一个老问题,但我想我会发布我的回复以防其他人遇到它。

      I wrote a Stream based implementation of uuencoding 用于具有大量单元测试的编码器和解码器。

      解码任何流:

      using (Stream encodedStream = /* Any readable stream. */)
      using (Stream decodedStream = /* Any writeable stream. */)
      using (var decodeStream = new UUDecodeStream(encodedStream))
      { 
          decodeStream.CopyTo(decodedStream);
          // Decoded contents are now in decodedStream.
      }
      

      编码任何流:

      bool unixLineEnding = // True if encoding with Unix line endings, otherwise false.
      using (Stream encodedStream = /* Any readable stream. */)
      using (Stream decodedStream = /* Any writeable stream. */)
      using (var encodeStream = new UUEncodeStream(encodedStream, unixLineEnding))
      {
          decodedStream.CopyTo(encodeStream);
          // Encoded contents are now in encodedStream.
      }
      

      【讨论】:

      • 我该如何使用它?这个有dll吗?
      • 在我的行长为 61 个字符的情况下,它总是抛出 Index out of range 异常
      猜你喜欢
      • 2016-07-13
      • 1970-01-01
      • 2012-02-26
      • 1970-01-01
      • 2023-02-08
      • 1970-01-01
      • 2015-04-22
      • 2013-02-06
      • 2023-02-22
      相关资源
      最近更新 更多