Esempio n. 1
0
 public static void BindYearMonth(DropDownList Year, DropDownList Month)
 {
     int num;
     Year.Items.Insert(0, new ListItem("请选择", ""));
     for (num = ShopConfig.ReadConfigInfo().StartYear; num <= ShopConfig.ReadConfigInfo().EndYear; num++)
     {
         Year.Items.Add(new ListItem(num.ToString(), num.ToString()));
     }
     Month.Items.Insert(0, new ListItem("请选择", ""));
     for (num = 1; num <= 12; num++)
     {
         Month.Items.Add(new ListItem(num.ToString(), num.ToString()));
     }
 }
Esempio n. 2
0
        protected void GetData()
        {
            string str = base.VirtualPath.Replace("/Ashx/" + ShopConfig.ReadConfigInfo().TemplatePath + "/", string.Empty).Replace(".ashx", ".htm");

            try
            {
                XueFuTemplateFile file = new XueFuTemplateFile(this.fileNameDic[str.ToLower()], "/Plugins/Template/" + ShopConfig.ReadConfigInfo().TemplatePath + "/");
                file.InheritsNameSpace = "XueFuShop.Pages";
                file.NameSpace         = "XueFuShop.Web";
                this.content           = file.Process();
            }
            catch
            {
                StringBuilder Output = new StringBuilder();
                foreach (KeyValuePair <string, string> info in this.fileNameDic)
                {
                    Output.Append(info.Key + ":" + info.Value + "<br>");
                }
                Output.Append("原始地址:" + base.VirtualPath + "替换目标:" + "/Ashx/" + ShopConfig.ReadConfigInfo().TemplatePath + "/" + "替换后的地址:" + base.VirtualPath.Replace("/Ashx/" + ShopConfig.ReadConfigInfo().TemplatePath + "/", string.Empty) + "现在请求的地址为:" + str.ToLower() + ",路径为:" + "/Plugins/Template/" + ShopConfig.ReadConfigInfo().TemplatePath + "/");
                this.content = Output.ToString();
            }
        }
Esempio n. 3
0
            private static bool CheckCookies()
            {
                string str = CookiesHelper.ReadCookieValue(cookiesName);

                if (str != string.Empty)
                {
                    try
                    {
                        string[] strArray = str.Split(new char[] { '|' });
                        string   str2     = strArray[0];
                        string   str3     = strArray[1];
                        string   str4     = strArray[2];
                        string   str5     = strArray[3];
                        string   str6     = strArray[4];
                        if (FormsAuthentication.HashPasswordForStoringInConfigFile(str3 + str4 + str5 + str6 + ShopConfig.ReadConfigInfo().SecureKey + ClientHelper.Agent, "MD5").ToLower() == str2.ToLower())
                        {
                            return(true);
                        }
                        CookiesHelper.DeleteCookie(cookiesName);
                    }
                    catch
                    {
                        CookiesHelper.DeleteCookie(cookiesName);
                    }
                }
                return(false);
            }
Esempio n. 4
0
        private void GetRightFileName()
        {
            string cacheKey = "ShopTemplateFile";

            if (CacheHelper.Read(cacheKey) == null)
            {
                List <FileInfo> list = FileHelper.ListDirectory(ServerHelper.MapPath("/Plugins/Template/" + ShopConfig.ReadConfigInfo().TemplatePath + "/"), "|.htm|");
                foreach (FileInfo info in list)
                {
                    string str2 = info.FullName.Replace(ServerHelper.MapPath(@"\Plugins\Template\" + ShopConfig.ReadConfigInfo().TemplatePath + @"\"), string.Empty).Replace(@"\", "/");
                    this.fileNameDic.Add(str2.ToLower(), str2);
                }
                CacheDependency cd = new CacheDependency(ServerHelper.MapPath("/Plugins/Template/" + ShopConfig.ReadConfigInfo().TemplatePath + "/"));
                CacheHelper.Write(cacheKey, this.fileNameDic, cd);
            }
            else
            {
                this.fileNameDic = (Dictionary <string, string>)CacheHelper.Read(cacheKey);
            }
        }
Esempio n. 5
0
 public override CacheDependency GetCacheDependency(string virtualPath, IEnumerable virtualPathDependencies, DateTime utcStart)
 {
     if (this.IsPathVirtual(virtualPath))
     {
         CacheDependency dependency  = new CacheDependency(ServerHelper.MapPath("/Plugins/Template/" + ShopConfig.ReadConfigInfo().TemplatePath + "/"));
         CacheDependency dependency2 = new CacheDependency(ServerHelper.MapPath("/Plugins/Template/" + ShopConfig.ReadConfigInfo().TemplatePath + "/User/"));
         //CacheDependency dependency4 = new CacheDependency(ServerHelper.MapPath("/Plugins/Template/" + ShopConfig.ReadConfigInfo().TemplatePath + "/English/"));
         //CacheDependency dependency5 = new CacheDependency(ServerHelper.MapPath("/Plugins/Template/" + ShopConfig.ReadConfigInfo().TemplatePath + "/English/User/"));
         AggregateCacheDependency dependency3 = new AggregateCacheDependency();
         dependency3.Add(new CacheDependency[] { dependency });
         dependency3.Add(new CacheDependency[] { dependency2 });
         //dependency3.Add(new CacheDependency[] { dependency4 });
         //dependency3.Add(new CacheDependency[] { dependency5 });
         return(dependency3);
     }
     return(base.Previous.GetCacheDependency(virtualPath, virtualPathDependencies, utcStart));
 }