]> insang Git - ZipProject.git/commitdiff
병합 위한 커밋
authorjoinsang <dhkq92@icloud.com>
Sun, 17 Feb 2019 11:35:47 +0000 (20:35 +0900)
committerjoinsang <dhkq92@icloud.com>
Sun, 17 Feb 2019 11:35:47 +0000 (20:35 +0900)
MinZip/MinZip.cpp
ZipProject/Controllers/WebZipController.cs
ZipProject/Models/LanguagePack.cs
ZipProject/Models/ZipModel.cs
ZipProject/Startup.cs

index ee8c0d197da7099a22c195a7c7e06e33d9ec5edb..3f2a746f77061013f7625d3ab0a380a7c53822f4 100644 (file)
Binary files a/MinZip/MinZip.cpp and b/MinZip/MinZip.cpp differ
index 19683905420b4abe12726d3ca1c8a310b51a5f55..fe8fa1b463de2d95cbb2a1d1e11731c1b1e0032c 100644 (file)
@@ -2,63 +2,53 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
-using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
 using ZipProject.Models;
 
-
 // For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
 
-namespace ZipProject.Controllers
-{
-    public class WebZipController : Controller
-    {
+namespace ZipProject.Controllers {
+  public class WebZipController : Controller {
 
-        private readonly ISession session;
+    private readonly ISession session;
 
-        public WebZipController(IHttpContextAccessor httpContextAccessor)
-        {
-            this.session = httpContextAccessor.HttpContext.Session;
-        }
-
-        // GET: /<controller>/
-        public IActionResult Index(string partial_name)
-        {
+    public WebZipController (IHttpContextAccessor httpContextAccessor) {
+      this.session = httpContextAccessor.HttpContext.Session;
+    }
 
-            ZipModel zmodel = new ZipModel();
-            zmodel.MakeZip("test");
+    // GET: /<controller>/
+    public IActionResult Index (string partial_name) {
+      ZipModel zmodel = new ZipModel ();
+      zmodel.MakeZip ("test");
 
-            if (string.IsNullOrEmpty(HttpContext.Session.GetString("lang")))
-            {
-                session.SetString("lang", "kr");
-            }
+      if (string.IsNullOrEmpty (HttpContext.Session.GetString ("lang"))) {
+        session.SetString ("lang", "kr");
+      }
 
-            if (string.IsNullOrEmpty(partial_name))
-                ViewData["partial_page"] = "partial_zip";
-            else
-                ViewData["partial_page"] = partial_name;
-            return View();
-        }
+      if (string.IsNullOrEmpty (partial_name))
+        ViewData["partial_page"] = "partial_zip";
+      else
+        ViewData["partial_page"] = partial_name;
+      return View ();
+    }
 
-        // Request files
-        public IActionResult ProcessingFiles()
-        {
+    // Request files
+    public IActionResult ProcessingFiles () {
 
-            return null;
-        }
-        
-        public IActionResult En()
-        {
-            session.SetString("lang", "en");
-            return Redirect("/");
-        }
+      return null;
+    }
 
-        public IActionResult Kr()
-        {
-            session.SetString("lang", "kr");
-            return Redirect("/");
-        }
+    public IActionResult En () {
+      session.SetString ("lang", "en");
+      return Redirect ("/");
+    }
 
+    public IActionResult Kr () {
+      session.SetString ("lang", "kr");
+      return Redirect ("/");
     }
 
-}
+  }
+
+}
\ No newline at end of file
index 4282bb59b201bdc339889c3d80be3308fad3b307..3e01bc765eaef8d3edd3cb1a8f4cc351004be1a9 100644 (file)
@@ -1,24 +1,21 @@
 using System;
-using Newtonsoft.Json;
 using System.IO;
+using Newtonsoft.Json;
 
-namespace ZipProject.Models
-{
-  public static class LanguagePack
-  {
+namespace ZipProject.Models {
+  public static class LanguagePack {
 
-    public static string GetText(string lang, string id)
-    {
+    public static string GetText (string lang, string id) {
 
       string path = Environment.CurrentDirectory + "/wwwroot/Language/" + lang + ".json";
-      string json = File.OpenText(path).ReadToEnd();
+      string json = File.OpenText (path).ReadToEnd ();
 
-      dynamic result = JsonConvert.DeserializeObject<dynamic>(json);
+      dynamic result = JsonConvert.DeserializeObject<dynamic> (json);
 
-      return (string)result[id];
+      return (string) result[id];
 
     }
 
   }
 
-}
+}
\ No newline at end of file
index 2fc12ea04487eeaa37e295367ca9f0690b873af7..ada818b95959f741b181df32211b2ceaf65115d5 100644 (file)
@@ -1,23 +1,17 @@
 using Ionic.Zip;
 
-namespace ZipProject
-{
-  public class ZipModel
-  {
+namespace ZipProject {
+  public class ZipModel {
 
     private readonly string[] _FOTMAT = { "zip", "7z", "rar" };
 
-    public ZipModel()
-    {
-    }
+    public ZipModel () { }
 
-    public void MakeZip(string name, string format = "zip")
-    {
-      using (ZipFile zip = new ZipFile())
-      {
-        //zip.AddDirectory("_zip/test");
-        //zip.Save("_zip/" + name + ".zip");
+    public void MakeZip (string name, string format = "zip") {
+      using (ZipFile zip = new ZipFile ()) {
+        zip.AddDirectory("_zip/test");
+        zip.Save("_zip/" + name + ".zip");
       }
     }
   }
-}
+}
\ No newline at end of file
index a9547a28bfc02bb92ab625858c83fc898386909c..f33d3247bd779979fdd2e6d364fe78f9532f6d5d 100644 (file)
@@ -1,19 +1,19 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Threading.Tasks;\r
-using Microsoft.AspNetCore.Builder;\r
-using Microsoft.AspNetCore.Hosting;\r
-using Microsoft.AspNetCore.Http;\r
-using Microsoft.AspNetCore.HttpsPolicy;\r
-using Microsoft.AspNetCore.Mvc;\r
-using Microsoft.Extensions.Configuration;\r
-using Microsoft.Extensions.DependencyInjection;\r
-\r
-namespace ZipProject\r
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.HttpsPolicy;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace ZipProject
 {
   public class Startup
-  {\r
+  {
     public Startup(IConfiguration configuration)
     {
       Configuration = configuration;
@@ -30,7 +30,7 @@ namespace ZipProject
         options.CheckConsentNeeded = context => false;
         options.MinimumSameSitePolicy = SameSiteMode.None;
       });
-      services.AddSession(s => s.IdleTimeout = TimeSpan.FromMinutes(5));\r
+      services.AddSession(s => s.IdleTimeout = TimeSpan.FromMinutes(5));
       services.AddHttpContextAccessor();
       services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
     }
@@ -60,5 +60,5 @@ namespace ZipProject
                   template: "{controller=WebZip}/{action=Index}/{id?}");
       });
     }
-  }\r
-}\r
+  }
+}