c#用rar压缩文件

来源:互联网 发布:红叶知弦与男主本子 编辑:程序博客网 时间:2024/06/05 20:18
            string startpath = "E:\\send\\one\\234";            string endpath = "E:\\savefile\\456.rar";            System.Diagnostics.Process pro = new System.Diagnostics.Process();            pro.StartInfo.FileName = System.Environment.CurrentDirectory + "\\WinRAR.exe";//WinRAR.exe的路径,放在exe同目录下            pro.StartInfo.Arguments = string.Format("a -en  -ep1 {0} {1}", endpath, startpath);//压缩保存文件,需要压缩的文件            pro.Start();            pro.WaitForExit();无期限等待进程退出            pro.Close();            pro.Dispose();



0 0
原创粉丝点击