コード例 #1
0
ファイル: ProjectsController.cs プロジェクト: bitiya/bitiya
        public List<WowSliderClass> GetImages(string imagesPath, string ttPath)
        {
            string MappedPath = Server.MapPath("~/" + imagesPath);

            DirectoryInfo imagesDirectory = new DirectoryInfo(MappedPath);

            FileInfo[] imagesInfo = imagesDirectory.GetFiles();

            IEnumerable<string> imgFiles = imagesInfo.Select(f => f.Name);
            ViewBag.imagePath = "../../" + imagesPath + "/";
            ViewBag.ttPath = "../../" + ttPath + "/";

            List<WowSliderClass> fc = new List<WowSliderClass>();
            foreach (string str in imgFiles)
            {
                WowSliderClass f = new WowSliderClass();
                f.imageName = str;
                f.ttName = str.ToLower();
                fc.Add(f);
            }

            ViewBag.tts = imgFiles.ToString().ToLower();

            return fc;
        }
コード例 #2
0
ファイル: GalleryController.cs プロジェクト: bitiya/bitiya
        //
        // GET: /Gallery/
        public ActionResult Index()
        {
            string imagesPath = "Wowslider/Events/HolmdelWalkathon/data1/images";
            string ttPath = "Wowslider/Events/HolmdelWalkathon/data1/tooltips";

            string MappedPath = Server.MapPath("~/" + imagesPath);

            DirectoryInfo imagesDirectory = new DirectoryInfo(MappedPath);

            FileInfo[] imagesInfo = imagesDirectory.GetFiles();

            IEnumerable<string> imgFiles = imagesInfo.Select(f => f.Name);
            ViewBag.imagePath = "../../" + imagesPath + "/";
            ViewBag.ttPath = "../../" + ttPath + "/";

            List<WowSliderClass> fc = new List<WowSliderClass>();
            foreach (string str in imgFiles)
            {
                WowSliderClass f = new WowSliderClass();
                f.imageName = str;
                f.ttName = str.ToLower();
                fc.Add(f);
            }

            ViewBag.tts = imgFiles.ToString().ToLower();
            return View(fc);
            //return View(fc);
        }