命令行调用rar,解压缩文件
2013-06-07 17:25
197 查看
public void UnCompressPackage(string PackagePhysicalFullPath) { //压缩文件存在的目录 string RARFilePath = Path.GetDirectoryName(PackagePhysicalFullPath); //解压到文件夹 string UnRARFilePath = Path.Combine(RARFilePath, Path.GetFileNameWithoutExtension(PackagePhysicalFullPath)); Directory.CreateDirectory(UnRARFilePath); //解压缩 String the_rar; RegistryKey the_Reg; Object the_Obj; String the_Info; ProcessStartInfo the_StartInfo; Process the_Process; the_Reg = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WinRAR.exe"); the_Obj = the_Reg.GetValue(""); the_rar = the_Obj.ToString(); the_Reg.Close(); the_Info = @" X " + " " + PackagePhysicalFullPath + " " + UnRARFilePath + " -y"; the_StartInfo = new ProcessStartInfo(); the_StartInfo.FileName = the_rar; the_StartInfo.Arguments = the_Info; the_StartInfo.WindowStyle = ProcessWindowStyle.Hidden; the_Process = new Process(); the_Process.StartInfo = the_StartInfo; the_Process.Start(); the_Process.WaitForExit(); the_Process.Close(); }
相关文章推荐
- c#调用 WinRAR.exe以命令行形式实现文件、文件夹的解压缩
- C#调用rar 压缩多个文件并删除压缩的文件
- nmake 的 batch mode (批模式) 推理规则可以用一次命令行调用编译多个文件
- nmake 的 batch mode (批模式) 推理规则可以用一次命令行调用编译多个文件
- asp.net利用RAR实现文件压缩解压缩(转)
- 让Ubuntu可以压缩/解压缩RAR文件
- 服务器端调用winzip命令行对上传的多个文件打包压缩
- C#调用rar 压缩多个文件并删除压缩的文件
- nmake 的 batch mode (批模式) 推理规则可以用一次命令行调用编译多个文件
- C#实现rar压缩与解压缩文件的方法
- nmake 的 batch mode (批模式) 推理规则可以用一次命令行调用编译多个文件
- 记录下关于调用RAR解压缩的问题
- 服务器端调用winzip命令行对上传的多个文件打包压缩
- nmake 的 batch mode (批模式) 推理规则可以用一次命令行调用编译多个文件
- [转]ubuntu下解压缩rar文件乱码的解决方案
- 调用winrar压缩解压缩文件
- python使用os.system(cmd)解压缩rar文件
- 如何在linux下解压缩rar格式的文件压缩包
- rar命令行解压zip文件提示不是 rar 压缩文件,没有可提取的文件的解决办法
- 如何在linux下解压缩rar格式的文件压缩包