How can I list the contents of a .zip folder in c#?

.NET 4.5 or newer finally has built-in capability to handle generic zip files with the System.IO.Compression.ZipArchive class (http://msdn.microsoft.com/en-us/library/system.io.compression.ziparchive%28v=vs.110%29.aspx) in assembly System.IO.Compression. No need for any 3rd party library. string zipPath = @”c:\example\start.zip”; using (ZipArchive archive = ZipFile.OpenRead(zipPath)) { foreach (ZipArchiveEntry entry in archive.Entries) { Console.WriteLine(entry.FullName); } }

Maven – how to include empty directories

According to this ticket MRESOURCES-36, there should be a <includeEmptyDirs> element, but only for Maven Resources Plugin 2.3. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.3</version> <configuration> <includeEmptyDirs>true</includeEmptyDirs> </configuration> </plugin> For Maven versions which included an older version of the Resources plugin: Until this issue is fixed, here is a workaround I’ve been using successfully. Add this plugin element … Read more

What does os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)) mean? python

That is a clever way to refer to paths regardless of the script location. The cryptic line you’re referring is: os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)) There are 3 methods and a 2 constants present: abspath returns absolute path of a path join join to path strings dirname returns the directory of a file __file__ refers to the script‘s … Read more

iOS: Can’t save file to ‘Application Support’ folder, but can to ‘Documents’

In case anyone is unsure how to do what rmaddy describes: NSString *appSupportDir = [NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) lastObject]; //If there isn’t an App Support Directory yet … if (![[NSFileManager defaultManager] fileExistsAtPath:appSupportDir isDirectory:NULL]) { NSError *error = nil; //Create one if (![[NSFileManager defaultManager] createDirectoryAtPath:appSupportDir withIntermediateDirectories:YES attributes:nil error:&error]) { NSLog(@”%@”, error.localizedDescription); } else { // *** OPTIONAL … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)