ASP.NET |窗体身份验证|让所有登录的用户(所有用户的列表或计数) [英] ASP.NET | Forms Authentication | Get ALL logged in users(list of all users or count)

查看:101
本文介绍了ASP.NET |窗体身份验证|让所有登录的用户(所有用户的列表或计数)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用.NET 3.5。
此外,窗体身份验证使用。

I am using .NET 3.5. Also, Forms Authentication is used.

有没有什么办法让名单所有登录用户的计数在ASP.NET?

Is there any way to get the list of ALL logged-in users or a count in ASP.NET?

注:我不使用成员资格和角色

推荐答案

没有没有,除非


  1. 您已经于您自己的code定义了一个

  1. You have defined one in your own code

您正在使用的定义了 GetNumberOfUsersOnline()法默认ASPNET成员资格提供程序。

You are using the default ASPNET Membership Provider which has a GetNumberOfUsersOnline() method defined.

您使用自定义成员资格提供程序,并提供了<$ C C> GetNumberOfUsersOnline()方法的实现自己

You are using a custom Membership Provider and have provided an implementation for the GetNumberOfUsersOnline() method yourself

默认ASPNET会员提供通过查询SQL Server数据库和检查在线计算用户数量的 LastActivityDate 存储反对对每一个用户定义的 UserIsOnlineTimeWindow 属性,你可以在web.config中设置。如果<$ C C> LastActivityDate 比当前时间减去<$ C C> UserIsOnlineTimeWindow 值(重新presents分钟)时,则用户被认为是在网上。

The default ASPNET Membership provider calculates number of users online by querying the SQL Server database and checking the LastActivityDate stored against each user against the defined UserIsOnlineTimeWindow property that you can set in web.config. If the LastActivityDate is greater than the current time minus the UserIsOnlineTimeWindow value (which represents minutes), then a user is considered to be online.

如果你想要做同样的事情,那么你可能考虑实施类似的方法。你可以看到code由的默认提供下载源$ C ​​$ C 。为了完成你的照片,你可能还需要运行 aspnet_regsql.exe的这样您就可以看到存储过程,默认的供应商使用。

If you wanted to do something similar then you might consider implementing a similar method. you can see the code for the default providers by downloading the source code. To complete your picture, you might also want to run aspnet_regsql.exe so that you can see the stored procedures that the default providers use.

这篇关于ASP.NET |窗体身份验证|让所有登录的用户(所有用户的列表或计数)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆