this question has answer here:
i new .net world , creating windows form in .net 4.5 using vs 2012 professional. in form trying extract file throws out error file more 2 gb. same code extracts smaller file no problem. there system configuration? please find business class extraction , me out this.
using system; using system.io; using system.io.compression; namespace automate.business { public class zipperclass { public string extract_withpathname(string zippath) { string extractpath = path.getdirectoryname(zippath); string extractname = path.getfilenamewithoutextension(zippath); using (ziparchive archive = zipfile.open(zippath, ziparchivemode.update)) { try { archive.extracttodirectory(extractpath); archive.dispose(); } catch (exception ex) { console.writeline(ex); } } return destination; } } }
thanks in advance.
if using .net 4.5 , 64 bit architecture, can set in app.config remove memory limit:
<gcallowverylargeobjects enabled="true" />
Comments
Post a Comment