C# 调用WinRar执行rar、zip压缩的代码
在研发过程中,将内容过程中比较好的一些内容做个收藏,如下内容内容是关于 C# 调用WinRar执行rar、zip压缩的内容,应该能对小伙伴有一些好处。
private static bool ExistsRar(out String winRarPath) { winRarPath = String.Empty; var registryKey = Registry.LocalMachine.OpenSubKey(@“SOFTWAREMicrosoftWindowsCurrentVersionApp PathsWinRAR.exe”); return !String.IsNullOrEmpty(winRarPath); } 压缩 public static void CompressRar(String path, String rarPath, String rarName) { try { String winRarPath = null; var pathInfo = String.Format(“a -afzip -m0 -ep1 “{0}” “{1}””, rarName, path); #region WinRar 用到的命令注释 #endregion var process = new Process { StartInfo = new ProcessStartInfo { }, }; } catch (Exception ex) { throw ex; } } 解压 public static String UnCompressRar(String unRarPath, String rarPath, String rarName) { try { String winRarPath = null; if (Directory.Exists(unRarPath) == false) { Directory.CreateDirectory(unRarPath); } var pathInfo = “x " + rarName + " " + unRarPath + " -y”; var process = new Process { StartInfo = new ProcessStartInfo { }, }; } catch (Exception ex) { throw ex; } return unRarPath; }
C# 调用WinRar执行rar、zip压缩的代码相关推荐
- win压缩包linux解压软件,linux解压rar,zip压缩文件教程
现在网上下载的文件很多都是rar,zip打包的,便于网络上传输,在Windows中只需要安装一个压缩软件那么加压rar,zip压缩文件就很方便了,那么在linux系统中呢,如何解压.zip和.rar文 ...
- 【转】C#执行rar,zip文件压缩的几种方法及我遇到的坑总结
工作项目中需要用到zip压缩解压缩文件,一开始看上了Ionic.Zip.dll这个类库,操作方便,写法简单 对应有个ziphelper类 using Ionic.Zip;public static c ...
- Python调用winrar.exe进行文件压缩
文章目录 前言 简介 压缩实例 目录结构 执行代码 运行结果 小结 前言 Python语言中有一个zipfile库,可以利用zip进行压缩解压.我们知道,通常 Rar 具有更高的压缩率.在Python ...
- C#调用WinRAR解压、压缩文件
0. 判断是否安装WinRAR public static bool ExistsRar(out String winRarPath) {winRarPath = String.Empty;//通过R ...
- [Python] 读取 rar/zip 压缩文件
一. 读取 rar 文件 Python 中 python-unrar 模块依赖于 UnRAR library, 所以需要先安装 UnRAR library 1. 安装 UnRAR library 在官 ...
- 通过php上传和下载rar/zip压缩文件
前端显示界面 <html> <head> <meta charset="utf-8"> <title>压缩文件上传下载</ti ...
- java 制作 winrar,windows 上java调用winrar压缩文件为rar 格式
windows 下java调用winrar压缩文件为rar 格式 windows 下java调用winrar压缩文件为rar 格式 import java.io.BufferedReader; im ...
- windows 下java调用winrar压缩文件为rar 格式
windows 下java调用winrar压缩文件为rar 格式 import java.io.BufferedReader; import java.io.IOException; import ...
- 程序调用winrar自动压缩文件
程序调用winrar自动压缩文件,有时在备份文件等,完成后需要用本机的winrar对文件自动压缩并拷贝走. 这里提供一个例程: try{String winRarPath = null;if (!Ex ...
最新文章
- 3个著名加密算法(MD5、RSA、DES)的解析
- 【正一专栏】魔鬼圣诞赛程结束争四利物浦占得先机
- map可以用结构体作为健值吗?
- 不安装cudnn可不可以_Ubuntu16.04+gtx1060+cuda8.0+cudnn8.0+tensorflow安装
- springboot多环境加载yml和logback配置
- STL学习系列一:STL(标准模板库)理论基础
- 使用Apache Ignite构建C++版本的分布式应用
- 【面向对象】第四单元总结——UML
- if分支语句(JS)
- Java学习环境的搭建
- 瑞利衰落的概念及应对技术——信道编码、交织、跳频
- LCP 03. 机器人大冒险
- Cortex-M中特别实用的DWT计数器
- .Net获取公司所有员工前一天钉钉考勤记录
- 你踩过几个?盘点微信H5小游戏开发中的那些坑
- 人脸识别方案(一)-ocr
- Route命令使用详解
- Lucene搜索引擎-搜索
- 使用python进行分布分析(算数平均、几何平均、偏度、峰度,绘制直方图),以2022年上半年沪深300指数为例
- 网件R6220路由器刷潘多拉盒子PandoraBox