コード例 #1
0
        public ActionResult ShowFolder(int id = 1)
        {
            string userEmail=(string)Session["email"];
            string userPassword=(string)Session["password"];

            if (userEmail == null || userPassword == null)
              return  RedirectToRoute("Logout");

            try
            {
                FileSystemClient serverFileSystem = new FileSystemClient();
                MyFile directoryInfo = serverFileSystem.GetDirectory(id, userEmail, userPassword);

                ViewData["currentPath"] = directoryInfo.Path;
                ViewData["currenId"] = id;
                ViewData["parentId"] = directoryInfo.ParentDirectoryId;
                ViewData["files"]= serverFileSystem.GetDirectoryFiles(id, false, userEmail, userPassword);
            }
            catch (Exception)
            {
                return RedirectToRoute("ShowFolder");
            }

            return View();
        }