Esempio n. 1
0
        /// <summary>
        /// 从缓存中读取一个图片对象
        /// </summary>
        /// <param name="RelativePath">图片相对路径</param>
        /// <param name="ImageDataPath">图片Txt文本路径</param>
        /// <returns></returns>
        public static FBImageInfo GetFBImageInfo(string RelativePath, string ImageDataPath)
        {
            List <FBImageInfo> cache = CacheHelper.Get <List <FBImageInfo> >("keyimagelist");

            if (cache == null)
            {
                CacheHelper.Insert("keyimagelist", FBCommon.LoadFBImage(ImageDataPath));
                cache = CacheHelper.Get <List <FBImageInfo> >("keyimagelist");
            }
            return(cache.Find(x => x.RelativePath == RelativePath));
        }
Esempio n. 2
0
        public static void RefreshCache(string imagedatapath)
        {
            List <FBImageInfo> cache = CacheHelper.Get <List <FBImageInfo> >("keyimagelist");

            if (cache == null)
            {
                CacheHelper.Insert("keyimagelist", FBCommon.LoadFBImage(imagedatapath));
                cache = CacheHelper.Get <List <FBImageInfo> >("keyimagelist");
            }
            else
            {
                cache.Clear();
                CacheHelper.Insert("keyimagelist", FBCommon.LoadFBImage(imagedatapath));
                cache = CacheHelper.Get <List <FBImageInfo> >("keyimagelist");
            }
        }
Esempio n. 3
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/html";
            string         template      = context.Server.MapPath("/Template");
            string         imageDataPath = context.Server.MapPath("~/imagedata.txt");
            VelocityHelper helper        = new VelocityHelper(template);

            if (context.Session["password"] != null)
            {
                if (context.Session["password"].ToString() == ConfigHelper.Password)
                {
                    List <FBImageInfo> ls = FBCommon.LoadFBImage(imageDataPath);
                    helper.PutSet("imagelist", ls);
                    helper.Display("imageview.html");
                }
            }
            else
            {
                helper.Display("password.html");
            }
        }