Sample C# .net code for zipping a file using 7zip

后端 未结 5 1628
终归单人心
终归单人心 2020-12-19 09:30

I have installed 7-zip 4.65 on my machine at C:\\Program files. I want to use it in C# code to zip a file. The file name will be provided by the user dynamically. Can any on

5条回答
  •  孤城傲影
    2020-12-19 09:49

    I suppose if you wish to use the installed one you have in c:\program files, you could just use System.Diagnostics.Process to run command line apps - http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx

    Passing parameters is easy too. There are plenty of examples here - http://www.c-sharpcorner.com/UploadFile/DipalChoksi/ShellCommandsInCS12032005042031AM/ShellCommandsInCS.aspx

提交回复
热议问题