【发布时间】:2010-10-27 03:34:35
【问题描述】:
我有一些 uuencoded 文件,我需要使用 .NET 2.0 或 Visual C++ 6.0 对它们进行解码。有什么好的库/类可以帮助到这里吗?看起来这不是 .NET 或 MFC 中内置的。
【问题讨论】:
标签: .net visual-c++
我有一些 uuencoded 文件,我需要使用 .NET 2.0 或 Visual C++ 6.0 对它们进行解码。有什么好的库/类可以帮助到这里吗?看起来这不是 .NET 或 MFC 中内置的。
【问题讨论】:
标签: .net visual-c++
试试 uudeview,here。它是一个运行良好的开源库,除了 uuencoded 文件之外,它还将处理日元文件。您可以将它与 C/C++ 一起使用,或者为 C# 编写互操作包装器,而不会有太多麻烦。
【讨论】:
Code Project 有一个 .NET 库 + 用于 uuencoding/decoding 的源代码。实际的算法本身在网络上传播得相当广泛,而且很短。
代码项目链接:http://www.codeproject.com/KB/security/TextCoDec.aspx
文章简介:
本文介绍了一个类库 用于编码/解码文件和/或 .NET 中几种算法中的文本。 这个库的一些特性:
在 Quoted 中编码/解码文本 可打印的编码/解码文件和 Base64 编码/解码文件中的文本 和 UUEncode 编码/解码中的文本 yEnc 中的文件
【讨论】:
我知道这是一个老问题,但我想我会发布我的回复以防其他人遇到它。
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.
}
【讨论】: