コード例 #1
0
        //
        // GET: /Clip/

        public ActionResult Index()
        {
            var    bolService   = new BOLService.BOLService();
            var    vImg         = bolService.GetRandomImage(1);
            string str          = vImg.First().linkimg;
            int    index        = str.LastIndexOf('.');
            string strExtension = str.Substring(index + 1);
            var    webClient    = new WebClient();

            webClient.DownloadFile(str, "D:\\Public\\Project_Tools_\\DemoDepVDWeb\\Demo1\\Download_\\" + vImg.First().ID + "." + strExtension);
            return(View());
        }
コード例 #2
0
        public ActionResult GenerateRandomImage(int?id)
        {
            var v          = id.HasValue ? id.Value : 15;
            var bolService = new BOLService.BOLService();
            var result     = bolService.GetRandomImage(v);
            var data       = result.Select(o => new ListItem()
            {
                Id   = o.ID,
                Name = o.linkimg
            });

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
コード例 #3
0
        public ActionResult RandomLinkImage(int?id)
        {
            var vAmountRows = id.HasValue ? id.Value : 15;
            var bolService  = new BOLService.BOLService();
            var result      = bolService.GetRandomImage(vAmountRows, 1, 0, string.Empty);
            var data        = result.Select(o => new ListItem()
            {
                Id   = o.ID,
                Name = o.linkimg
            });

            return(Json(data, JsonRequestBehavior.AllowGet));
        }