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;
        }
posted on 2007-11-27 09:38  小角色  阅读(383)  评论(0)    收藏  举报