62,046
社区成员
发帖
与我相关
我的任务
分享
protected void Button8_Click(object sender, EventArgs e)
{
string code = txt.Text;
List<Summarys> list = new List<Summarys>();
for (int i = 1; i <= 30; i++)
{
Summarys model = EbApi.getsummarys(h.auth_key, DateTime.Now.AddDays(-i), code);
list.Add(model);
}
System.Web.Caching.Cache cache = System.Web.HttpContext.Current.Cache;
if (cache["list_"+code]!=null)
{
cache.Remove("list_"+code);
}
cache.Insert("list_" + code, list, null, DateTime.Now.AddHours(2), System.Web.Caching.Cache.NoSlidingExpiration);
}