Unzip a file in c# using 7z.exe -
i'm trying unzip file winform application. i'm using code :
string dezarhiverpath = @appdomain.currentdomain.basedirectory + "\\7z.exe"; processstartinfo pro = new processstartinfo(); pro.windowstyle = processwindowstyle.hidden; pro.filename = dezarhiverpath; pro.arguments = @" e c:\test.zip"; process x = process.start(pro); x.waitforexit();
the code doesn't return error doesn't anything. tried command cmd :
k:\>"c:\test\7z.exe" e "c:\test.zip"
but in cmd ,i receive error message :
7-zip cannot find code works archives.
can me unzip files c# ?
thanks!
why bother trying use 7z.exe application externally? kludgy way of doing it. instead use 1 of many libraries @ disposal.
if new application, , targeting .net 4.5, new system.io.compression
namespace has zipfile
class.
alternatively, sharpziplib
gpl library file compression in .net. there online samples.
also available dotnetzip ms-pl licensed.
Comments
Post a Comment