public ActionResult Index(String name)
        {
            var chemin = (string)MySession.GetChemin();

            FileInfo       file           = new FileInfo(Path.Combine(Debug.LocalStorage(), name));
            FileSystemItem fsi            = FileSystemItem.GetElement(chemin + "/" + name, MySession.GetUser().Id);
            DisplayContent displayContent = new DisplayContent();

            displayContent.ProcessStart(fsi.FilePath);

            /*if (chemin != null)
             * {
             *  string fileURL = Path.Combine(Debug.LocalStorage(), chemin.ToString(), name);
             *  file = new FileInfo(fileURL);
             *
             * }
             * if (file.Exists)
             * {
             *  if (ViewerModel.ExtensionImage.ToList().Contains(file.Extension.ToLower()))
             *  {
             *      DisplayContent displayContent = new DisplayContent();
             *
             *      displayContent.ProcessStart(file.ToString());
             *
             *  }
             * }*/

            return(RedirectToAction("Index", "Home", new { Chemin = chemin }));
        }
Example #2
0
        // GET: DisplayMovie
        public ActionResult Index(string name)
        {
            var chemin = (string)MySession.GetChemin();

            FileInfo file = new FileInfo(Path.Combine(Debug.LocalStorage(), name));

            if (chemin != null)
            {
                string fileURL = Path.Combine(Debug.LocalStorage(), chemin.ToString(), name);
                file = new FileInfo(fileURL);
            }
            if (file.Exists)
            {
                if (ViewerModel.ExtensionMovie.ToList().Contains(file.Extension.ToLower()))
                {
                    DisplayContent displayContent = new DisplayContent();

                    displayContent.ProcessStart(file.ToString());
                }
            }

            return(RedirectToAction("Index", "Home", new { Chemin = chemin }));
        }