62,074
社区成员
发帖
与我相关
我的任务
分享
AdminPage 类
protected static User u= new User ();
Page_load() 函数 从数据库中读取信息给 对象u
protected 函数A 对对象u操作
protected 函数B 对对象u操作
public UserInfo 获取某用户的信息(string id)
{
var cache = System.Web.HttpRuntime.Cache;
var key = "用户__" + id + "的信息";
var usr = (UserInfo)cache[key];
if (usr == null)
{
usr = 读取数据库查询用户信息(id);
cache.Insert(key, usr);
}
return usr;
}