0

我试图通过使用 ICSharpCode.SharpZipLib 的代码解压缩 bz2 文件。

似乎无论我在哪里制作文件,即使我可以完全访问它,我仍然会收到此异常。非常感谢任何帮助。

using System;
using System.IO;

using ICSharpCode.SharpZipLib.BZip2;

namespace decompressor 
{ 
    class MainClass
    {
        public static void Main(string[] args)
        {
            string filePath = "C:\\FreeBase\\opinions.tsv.bz2";
            string decompressPath = "C:\\Users\\mike\\Desktop\\Decompressed";

            Console.WriteLine("Decompressing {0} to {1}", file, path);
             BZip2.Decompress(File.OpenRead(filePath),File.OpenWrite(decompressPath), true);                
        }       
    }
}
4

2 回答 2

1

您的代码无权在桌面上创建新路径。检查"C:\\Users\\mike\\Desktop\\Decompressed".

于 2011-07-15T20:13:56.200 回答
0

也许,你应该这样写:

string decompressPath = "C:\\Users\\mike\\Desktop\\Decompressed\\opinions.tsv";
于 2014-02-28T20:59:44.663 回答