
private static PageInfo GetPageInfoByUrlInXml(string url)
{
Hashtable hs =new Hashtable();
PageInfo pi=null;
if (HttpContext.Current.Cache["PageInfo"]!=null)
{
hs = (Hashtable) HttpContext.Current.Cache["PageInfo"];
if (hs == null)
{
hs = SiteCommon.XMLFunction.GetPageInfoByXML();
HttpContext.Current.Cache.Remove("PageInfo");
HttpContext.Current.Cache.Insert("PageInfo",hs,null,
System.Web.Caching.Cache.NoAbsoluteExpiration,
TimeSpan.FromDays(30));
}
}
else
{
hs = SiteCommon.XMLFunction.GetPageInfoByXML();
HttpContext.Current.Cache.Insert("PageInfo", hs,null,System.Web.Caching.Cache.NoAbsoluteExpiration,
TimeSpan.FromDays(30));
}
foreach(System.Collections.DictionaryEntry de in hs)
{
if (url.IndexOf(de.Key.ToString().ToLower()) != -1 && url.ToLower().Trim()!="/index.aspx") return (PageInfo) hs[de.Key.ToString()];
}
return pi;
}

浙公网安备 33010602011771号