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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -