string dbName = ConfigurationManager.AppSettings["CacheDatabaseName"];
            string tableConfig = ConfigurationManager.AppSettings[configKey];
            string[] tables = tableConfig.Split(configurationSeparator);            foreach (string tableName in tables)
                dependency.Add(new SqlCacheDependency(dbName, tableName));使用的时候这么用
 public static string GetCategoryName(string categoryId) {            Category category = new Category();
            if (!enableCaching)
                return category.GetCategory(categoryId).Name;            string cacheKey = string.Format(CATEGORY_NAME_KEY, categoryId);            // Check if the data exists in the data cache
            string data = (string)HttpRuntime.Cache[cacheKey];
            if (data == null) {
                // Caching duration from Web.config
                int cacheDuration = int.Parse(ConfigurationManager.AppSettings["CategoryCacheDuration"]);                // If the data is not in the cache then fetch the data from the business logic tier
                data = category.GetCategory(categoryId).Name;                // Create a AggregateCacheDependency object from the factory
                AggregateCacheDependency cd = DependencyFacade.GetCategoryDependency();                // Store the output in the data cache, and Add the necessary AggregateCacheDependency object
                HttpRuntime.Cache.Add(cacheKey, data, cd, DateTime.Now.AddHours(cacheDuration), Cache.NoSlidingExpiration, CacheItemPriority.High, null);
            }            return data;
        }具体参加PetShop4.0
  
*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html