问题如题目,谢谢.

解决方案 »

  1.   

    rar是一个特定的软件,有着它的自己的格式,在C#里没有相应的一个类能和它完全一样的实现RAR的功能,如果一定要处理,那么最好使用Process类来启动RAR的处理程序来专门的处理RAR文件.
      

  2.   

    System.Diagnostics.Process.Start(fileName, argument)
    或使用StartInfo来设置参数信息使用Start来启动进程
      

  3.   

    Process p = new Process();
    ProcessStartInfo processInfo = new ProcessStartInfo("C:\\Program Files\\WinRAR\\WinRAR.exe", "d:\\aa.rar");
    p.Start(processInfo);
    p.Start();
      

  4.   

    可以用开源的库,sharpzip吧,在网上搜索一下,使用比较简单的
      

  5.   

    J#里面有个自解压的类库dll,可以在服务器端自解压的 
    忘了那个Dll的名字叫什么了
      

  6.   

    调用这个就可以了.
    public static void DecompressFile(string sourceFile, string destinationFile)
        {
            if (!File.Exists(sourceFile)) throw new FileNotFoundException();
            using (FileStream sourceStream = new FileStream(sourceFile, FileMode.Open))
            {
                byte[] quartetBuffer = new byte[4];
                int position = (int)sourceStream.Length - 4;
                sourceStream.Position = position;
                sourceStream.Read(quartetBuffer, 0, 4);
                sourceStream.Position = 0;
                int checkLength = BitConverter.ToInt32(quartetBuffer, 0);
                byte[] buffer = new byte[checkLength + 100];
                using (GZipStream decompressedStream = new GZipStream(sourceStream, CompressionMode.Decompress, true))
                {
                    int total = 0;
                    for (int offset = 0; ; )
                    {
                        int bytesRead = decompressedStream.Read(buffer, offset, 100);
                        if (bytesRead == 0) break;
                        offset += bytesRead;
                        total += bytesRead;
                    }
                    using (FileStream destinationStream = new FileStream(destinationFile, FileMode.Create))
                    {
                        destinationStream.Write(buffer, 0, total);
                        destinationStream.Flush();
                    }
                }
            }
        }
      

  7.   

    到这里下载
    http://www.rarlab.com/rar_add.htm