{"id":182,"date":"2010-06-30T20:00:00","date_gmt":"2010-06-30T11:00:00","guid":{"rendered":"http:\/\/astel-labs.net\/blog\/diary\/2010\/06\/100630-1.html"},"modified":"2012-03-11T20:51:53","modified_gmt":"2012-03-11T11:51:53","slug":"100630-1","status":"publish","type":"post","link":"https:\/\/astel-labs.net\/blog\/diary\/2010\/06\/100630-1.html","title":{"rendered":"C#\u3067Zip\u5727\u7e2e\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u64cd\u4f5c"},"content":{"rendered":"<p>C# \u3067Zip\u306a\u3069\u306e\u5727\u7e2e\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u64cd\u4f5c\u3057\u305f\u3044\u3068\u3044\u3046\u3053\u3068\u306f\u3088\u304f\u3042\u308b\u3068\u601d\u3044\u307e\u3059<br \/>\n\uff08\u3042\u308a\u307e\u3059\u3088\u306d\uff1f<\/p>\n<p>&nbsp;<\/p>\n<p>.net \u306b\u3082Zip\u5f62\u5f0f\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u6271\u3046\u6a19\u6e96\u30af\u30e9\u30b9\u30e9\u30a4\u30d6\u30e9\u30ea\u306f\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u304c\u3001\u8907\u6570\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u5727\u7e2e\u3057\u305f\u3044\u306a\u3069\u306e\u4e00\u822c\u7684\u306a\u7528\u9014\u306b\u306f\u4f7f\u3048\u308b\u3068\u306f\u8a00\u3048\u307e\u305b\u3093<br \/>\n\u30fbGZipStream\u30af\u30e9\u30b9\uff08System.IO.Compression\u540d\u524d\u7a7a\u9593\uff09<br \/>\n\u30fbZipPackage\u30af\u30e9\u30b9(System.IO.Packaging\u540d\u524d\u7a7a\u9593)<\/p>\n<p>&nbsp;<\/p>\n<p>\u300cC#\u3000zip\u300d\u306a\u3069\u306e\u30d5\u30ec\u30fc\u30ba\u3067\u30cd\u30c3\u30c8\u3092\u691c\u7d22\u3059\u308b\u3068\u3001\u3044\u304f\u3064\u304b\u306e .net \u5bfe\u5fdc zip \u64cd\u4f5c\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u898b\u3064\u304b\u308a\u307e\u3059\u304c\u3001\u81ea\u4f5c\u3057\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u6dfb\u4ed8\u3057\u305f\u3044\u3068\u601d\u3046\u3068\u3001\u30e9\u30a4\u30bb\u30f3\u30b9\u304c\u6c17\u306b\u306a\u308a\u307e\u3059<\/p>\n<p>\u305d\u3053\u3067\u304a\u52e7\u3081\u306a\u306e\u304c\u3001\u30de\u30a4\u30af\u30ed\u30bd\u30d5\u30c8\u304c\u516c\u958b\u3057\u3066\u3044\u308b\u300c<a href=\"http:\/\/www.codeplex.com\/DotNetZip\">DotNetZip Library<\/a>\u300d\u3067\u3059<\/p>\n<p>\u300cDotNetZip\u300d\u306f\u3001\u30de\u30a4\u30af\u30ed\u30bd\u30d5\u30c8\u304c\u3082\u3063\u3068\u3082\u5236\u9650\u306e\u7de9\u3044\u300c<strong><a href=\"http:\/\/www.microsoft.com\/japan\/resources\/sharedsource\/licensingbasics\/sharedsourcelicenses.mspx\">Microsoft Permissive License (Ms-PL)<\/a><\/strong>\u300d\u30e9\u30a4\u30bb\u30f3\u30b9\u3067\u516c\u958b\u3057\u3066\u3044\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059<\/p>\n<p>&nbsp;<\/p>\n<p><!--more--><\/p>\n<p>\u64cd\u4f5c\u65b9\u6cd5\u3082\u7c21\u5358\u3067\u3001\u300cDotNetZip\u300d\u306e\u30b5\u30a4\u30c8\u304b\u3089\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3001\u300cIonic.Zip.dll\u300d\u3092\u5c55\u958b\u3057\u307e\u3059<\/p>\n<p>VisualStudio \u3067 C# \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u3001\u53c2\u7167\u8a2d\u5b9a\u304b\u3089\u300cIonic.Zip.dll\u300d\u3092\u53c2\u7167\u3057\u307e\u3059<br \/>\n\uff08\u3053\u306e\u3068\u304d\u3001\u300cIonic.Zip.dll\u300d\u3092\u30ed\u30fc\u30ab\u30eb\u306b\u30b3\u30d4\u30fc\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\uff09<\/p>\n<p>\u3042\u3068\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304d\u307e\u3059<\/p>\n<pre class=\"brush: csharp\">\r\n\/\/ \u30d5\u30a1\u30a4\u30eb\u540d\u3092\u6307\u5b9a\u3057\u3066\u89e3\u51cd\r\nusing( ZipFile zip = ZipFile.Read( &quot;filename.zip&quot; ) ) {\r\n    foreach( ZipEntry entry in zip ) {\r\n        \/\/ \u89e3\u51cd\u3059\u308b\r\n        entry.Extract();\r\n    }\r\n}\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u3053\u308c\u3067 Zip \u30d5\u30a1\u30a4\u30eb\u306e\u89e3\u51cd\u304c\u51fa\u6765\u307e\u3059<\/p>\n<p>\u5727\u7e2e\u306a\u3069\u306e\u8a73\u3057\u3044\u60c5\u5831\u306f\u3001\u300cDotNetZip\u300d\u306e\u30b5\u30a4\u30c8\u304b\u3089\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u53c2\u7167\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C# \u3067Zip\u306a\u3069\u306e\u5727\u7e2e\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u3092\u64cd\u4f5c\u3057\u305f\u3044\u3068\u3044\u3046\u3053\u3068\u306f\u3088\u304f\u3042\u308b\u3068\u601d\u3044\u307e\u3059 \uff08\u3042\u308a\u307e\u3059\u3088\u306d\uff1f &nbsp; .net \u306b\u3082Zip\u5f62\u5f0f\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u6271\u3046\u6a19\u6e96\u30af\u30e9\u30b9\u30e9\u30a4\u30d6\u30e9\u30ea\u306f\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u304c\u3001\u8907\u6570\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u5727\u7e2e\u3057\u305f\u3044 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,4],"tags":[],"class_list":["post-182","post","type-post","status-publish","format-standard","hentry","category-c","category-4"],"_links":{"self":[{"href":"https:\/\/astel-labs.net\/blog\/diary\/wp-json\/wp\/v2\/posts\/182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/astel-labs.net\/blog\/diary\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/astel-labs.net\/blog\/diary\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/astel-labs.net\/blog\/diary\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/astel-labs.net\/blog\/diary\/wp-json\/wp\/v2\/comments?post=182"}],"version-history":[{"count":1,"href":"https:\/\/astel-labs.net\/blog\/diary\/wp-json\/wp\/v2\/posts\/182\/revisions"}],"predecessor-version":[{"id":218,"href":"https:\/\/astel-labs.net\/blog\/diary\/wp-json\/wp\/v2\/posts\/182\/revisions\/218"}],"wp:attachment":[{"href":"https:\/\/astel-labs.net\/blog\/diary\/wp-json\/wp\/v2\/media?parent=182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/astel-labs.net\/blog\/diary\/wp-json\/wp\/v2\/categories?post=182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/astel-labs.net\/blog\/diary\/wp-json\/wp\/v2\/tags?post=182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}