How to extract ZIP files with WinRAR command line?

后端 未结 4 1450
一个人的身影
一个人的身影 2021-02-07 09:30

While trying to extract zip files I get the error:

c:\\path\\name.zip is not RAR archive
No files to extract

My code is:

4条回答
  •  说谎
    说谎 (楼主)
    2021-02-07 10:06

    rar.exe can indeed only unpack rar files. It's not at all the same as WinRAR.

    For unpacking ZIP files in .NET, you might want to look at the DotNetZip library instead. It has a license compatible with commercial software, unlike CSharpZipLib.

    If you need to support RAR as well, you can use UnRAR.dll with pinvoke:
    http://www.rarlab.com/rar_add.htm
    http://www.rarlab.com/rar/UnRARDLL.exe

    Or this .NET unRAR libary:
    http://www.chilkatsoft.com/rar-dotnet.asp

    Perhaps this one for 7zip.

提交回复
热议问题