首先你要有足够的权限才行,至少能运行cmd命名

解决方案 »

  1.   

    使用 Gzip在线解压文件
     public void DecompressFile(string sourceFile, string destinationFile)
        {
            //判读文件是否存在
            if (!File.Exists(sourceFile)) throw new FileNotFoundException();
            //创建FileStream对象,在执行完{}中的代码后自动释放该对象资源
            using (FileStream sourceStream = new FileStream(sourceFile, FileMode.Open))
            {
                byte[] quartetBuffer = new byte[4];//创建byte数组
                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];//创建byte数组
                //创建GZipStream对象,在执行完{}中的代码后自动释放该对象的资源
                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;
                    }
                    //创建FileStream对象,在执行完{}中的代码后自动释放该对象的资源
                    using (FileStream destinationStream = new FileStream(destinationFile, FileMode.Create))
                    {
                        destinationStream.Write(buffer, 0, total);//将缓冲区中的数据写入流
                        destinationStream.Flush();//清除缓冲区
                    }
                }
            }       
     
        }
      

  2.   

    先完成上传,上传完毕后再调用winrar或者7z进行解压操作。
      

  3.   

    WINRAR的命令行参数
    http://www.cnblogs.com/pclook/archive/2009/05/06/1450539.html你上传成功后,调用winrar,用命令行的模式执行以下winrar(用参数来指定解压路径)。
    当然你上传的这个账号必须有权限来调用.exe程序。http://blog.csdn.net/eigo/article/details/1827789
    asp.net调用WinRAR来压缩文件