我现在做一个考试系统,遇到一个问题,做考试系统需要通过代码解压文件,但又不想让用户看到解压过程,就是想让解压过程后台运行,该怎么做?(C#)
先谢谢各位了!

解决方案 »

  1.   

    ICSharpCode.SharpZipLib.dll File1.PostedFile.SaveAs(strPath);
    string []FileProperties=new string[2];
    FileProperties[0]=strPath; //待解压的文件
    FileProperties[1]=strPhotoPath+@"\";//解压后放置的目标目录
    UnZip(FileProperties);
    process  调用winrar解压
      

  2.   

    这个调用系统的rar ,传的参数看看rar文件夹下面的txt帮助文档。
      

  3.   

    使用 System.IO.Compression.GZipStream 类。
    或第三方的类,如:http://dotnetzip.codeplex.com
      

  4.   

    这个调用系统的rar ,传的参数看看rar文件夹下面的txt帮助文档。
      

  5.   

    action
    backgroudworker
    begininvoke
      

  6.   

    http://topic.csdn.net/u/20101114/13/41a1869e-36ab-4467-97ee-e5e8d1e046f1.html
      

  7.   

    tempDir = SharpZipLib(tempDir,m_inputFile.PostedFile.InputStream)        //解压缩
            private string SharpZipLib(string tempDir,Stream fileStream)
            {
                using (ZipInputStream s = new ZipInputStream(fileStream))
                {                string tempDirXLS = tempDir.Substring(0, tempDir.Length - 4);
                    tempDirXLS = tempDirXLS + ".xls";                ZipEntry theEntry;
                    while ((theEntry = s.GetNextEntry()) != null)
                    {                    Console.WriteLine(theEntry.Name);                    string directoryName = Path.GetDirectoryName(theEntry.Name);
                        string fileName = Path.GetFileName(theEntry.Name);                    // create directory
                        if (directoryName.Length > 0)
                        {
                            Directory.CreateDirectory(directoryName);
                        }                    if (fileName != String.Empty)
                        {
                            using (FileStream streamWriter = File.Create(tempDirXLS))
                            {                            int size = 2048;
                                byte[] data = new byte[2048];
                                while (true)
                                {
                                    size = s.Read(data, 0, data.Length);
                                    if (size > 0)
                                    {
                                        streamWriter.Write(data, 0, size);
                                    }
                                    else
                                    {
                                        break;
                                    }
                                }
                            }
                        }
                    }                //System.IO.File.Delete(tempDir); //解压缩成功后,删除zip文件
                    return tempDirXLS;            }
    这是我以前作的