[C#] 纯文本查看 复制代码using System.IO;
using SevenZip.Compression.LZMA;
namespace UnLZMA
{
internal static class UNLZMA
{
public static void DecompressFile(string inputFilePath, string outputFilePath)
{
using (FileStream inStream = new FileStream(inputFilePath, FileMode.Open, FileAccess.Read))
using (FileStream outStream = new FileStream(outputFilePath, FileMode.Create, FileAccess.Write))
using (Decoder decoder = new Decoder())
{
byte[] properties = new byte[5];
inStream.Read(properties, 0, 5);
long outSize = inStream.Length - 13;
decoder.SetDecoderProperties(properties);
long compressedSize = decoder.Decode(inStream, outStream, outSize);
}
}
}
}
网上搜到的结果和AI答复的结果都是这样写的,但是到来我这里就报错说“Decoder”: using 语句中使用的类型必须可隐式转换为“System.IDisposable”,我无论是把命名空间写在代码里还是写在前面都是这个样子,这是怎么回事,有大佬知道吗
[i]