62,195
社区成员
发帖
与我相关
我的任务
分享
public static ArrayList NewsList(int id)
{
string cachekey = "NewsList" + id.ToString();
if(HttpRuntime.Cache[cachekey] == null)
{
HttpRuntime.Cache.Insert(cachekey,Test.DAL.NewsList(id),null,DateTime.Now.AddHours(1),TimeSpan.Zero);
}
return (ArrayList)HttpRuntime.Cache[cachekey];
}
public static ArrayList NewsList(int id,out int num)
{
string cachekey = "NewsList" + id.ToString();
if(HttpRuntime.Cache[cachekey] == null)
{
HttpRuntime.Cache.Insert(cachekey,Test.DAL.NewsList(id,out num),null,DateTime.Now.AddHours(1),TimeSpan.Zero);
}
return (ArrayList)HttpRuntime.Cache[cachekey];
}