c# asp.net 解压rar文件

 Process cmdProcess = null;
                Process unzipProcess = null;

                try
                {
                    cmdProcess = new Process();
                    cmdProcess.StartInfo.UseShellExecute = false;
                    cmdProcess.StartInfo.RedirectStandardInput = true;
                    cmdProcess.StartInfo.RedirectStandardOutput = true;
                    cmdProcess.StartInfo.RedirectStandardError = true;
                    cmdProcess.StartInfo.CreateNoWindow = true;
                    cmdProcess.StartInfo.FileName = "cmd.exe";
                    cmdProcess.Close();
                    cmdProcess.Dispose();
                    cmdProcess = null;

                    unzipProcess = new Process();
                    unzipProcess.StartInfo.FileName = "C:/Program Files/WinRAR/WinRAR.exe";
                    unzipProcess.StartInfo.Arguments = " x -inul -y " + magazineLocal + " " + maNoLocalFold ;//解压的文件和解压到的地方
;
                    unzipProcess.Start();
                    while (!unzipProcess.HasExited)
                    {
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                finally
                {
                    unzipProcess.Close();
                    unzipProcess.Dispose();
                    unzipProcess = null;
                }

本文使用Blog_Backup未注册版本导出,请到soft.pt42.com注册。

原文地址:https://www.cnblogs.com/zjypp/p/2319521.html