好像是用的webservice实同的,,不知道是不是?
IDataProviderBase是不是?
IDataProviderBase是不是?
解决方案 »
- 机器语言是如何控制硬件响应的?大神请务必进来帮小弟解惑。
- 如何通过.net后台代码获取js传的值
- sql语句
- “/”应用程序中的服务器错误。
- 为什么每次操作后都关闭数据库链接再打开数据库操作的效率特别低?不关闭就出错
- 为什么调用Application_End事件没有把值存入文本?
- datagrid超链问题?再线急等!各位帮忙!
- 打包安装时数据库能否选装,让他选是否安装数据库,或只安装程序文件
- 帮忙看下代码,为何不显示数据??
- 关于ComponentOne Studio.NET问题
- 从数据库里读数据生成树菜单?
- 在datagrid中,点击按钮列中的某一选择按钮,如何得到所在的行?兄弟姐妹们,出手了!
private void Application_AuthenticateRequest(Object source, EventArgs e)实现
void Application_AuthenticateRequest(Object sender, EventArgs e) {
UserRoles forumRoles = new UserRoles();
forumRoles.GetUserRoles();
}
能不能解释一下啊?
// Read from the cache if available
if (HttpContext.Current.Cache["WhoIsOnline"] == null) { // Create Instance of the IDataProviderBase
IDataProviderBase dp = DataProvider.Instance();
// Get the users
users = dp.WhoIsOnline(pastMinutes);
// Add to the Cache HttpContext.Current.Cache.Insert("WhoIsOnline", users, null, DateTime.Now.AddMinutes(5), TimeSpan.Zero);
}
return (UserCollection) HttpContext.Current.Cache["WhoIsOnline"]; }
这一段应该是定义了一个全局静态方法,用来更新缓存的用户数据,你仔细看一下人家的注释void Application_AuthenticateRequest(Object sender, EventArgs e) {
UserRoles forumRoles = new UserRoles();
forumRoles.GetUserRoles();
}创建一个类,获取用户的权限吧你是在那下的这个例子?
就在WWW.ASP.NET下的呀,ASPNETFORUM是微软的模范论坛,有全部源码,和数据库文件,可惜看不蛮懂^_^.
public static UserCollection WhoIsOnline(int pastMinutes) 定义了一个全局静态方法,用来更新缓存的用户数据,我也大体也知道,就是“读出在线用户”
Application_AuthenticateRequest(Object sender, EventArgs e)获取用户的权限,好像也没有往数据库记录在线用户呀。
我就是不明白,她在哪里“写入在线用户”呢?没找到地方,想学着用呀