BLL/SiteUrl.cs
(完整代码) 1KBusing System;
using System.Collections;
using System.Text;
using System.IO;
using System.Web;
using System.Web.Caching;
namespace BLL
{
public class SiteUrl
{
private readonly DAL.SiteUrl dal = new DAL.SiteUrl();
public Hashtable loadConfig(string urlFilePath)
{
//从缓存中根据键读取,并使用as转换
Hashtable Cache_Siteurl = HttpContext.Current.Cache["Cache_Siteurl"] as Hashtable;
if (Cache_Siteurl == null)
{
//创建缓存依赖项
CacheDependency dependency = new CacheDependency(urlFilePath);
//创建缓存
HttpContext.Current.Cache.Add("Cache_Siteurl", dal.loadConfig(urlFilePath), dependency, Cache.NoAbsoluteExpiration, new TimeSpan(0, 30, 0), CacheItemPriority.Default, null);
Cache_Siteurl = HttpContext.Current.Cache["Cache_Siteurl"] as Hashtable;
}
return Cache_Siteurl;
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。