c# 解压文件

  public bool UnRAR(string destPath, string rarfilePath)
        {
            try
            {
                // destPath = @"E:youxiaodi	emp"; //目标位置
                // rarfilePath = @"E:youxiaodi	empgif.rar"; //被解压文件
                //组合出需要shell的完整格式
                string shellArguments = string.Format("x -o+ "{0}" "{1}\"",
                    rarfilePath, destPath);
                //用Process调用
                using (Process unrar = new Process())
                {
                    unrar.StartInfo.FileName = @"C:Program FilesWinRARUnRAR.exe";
                    unrar.StartInfo.Arguments = shellArguments;
                    //隐藏rar本身的窗口
                    unrar.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
                    unrar.Start();
                    //等待解压完成
                    unrar.WaitForExit();
                    unrar.Close();
                }
            }
            catch (Exception ex)
            {
                return false;
            }
            return true;
        }
原文地址:https://www.cnblogs.com/pigddyou/p/3714157.html