我的应用程序允许管理员暂停/取消暂停用户帐户.我使用以下代码执行此操作:
MembershipUser user = Membership.GetUser(Guid.Parse(userId));
user.IsApproved = false;
Membership.UpdateUser(user);
Run Code Online (Sandbox Code Playgroud)
以上工作可以暂停用户,但不会撤消他们的会话.因此,只要其会话cookie仍然存在,被挂起的用户就可以继续访问该应用程序.任何修复/
有人检查电子邮件地址的域名作为其验证步骤的一部分吗?例如.如果用户指定blah@gmail.com作为他们的地址,请确认gmail.com存在.
我应该注意,在我的webapp中,现有用户可以将邀请转发给他们的朋友.我根本不需要验证这些邀请.相反,我只是想警告我的用户是否有错字等可能正在向错误的人发送邀请.这甚至值得吗?
I set up various global parameters in Global.asax, as such:
Application["PagePolicies"] = "~/Lab/Policies.aspx";
Application["PageShare"] = "/Share.aspx";
Application["FileSearchQueries"] = Server.MapPath("~/Resources/SearchQueries.xml");
...
Run Code Online (Sandbox Code Playgroud)
I have no problem accessing these variables form .ascx.cs or .aspx.cs file -- ie. files that are part of the Web content. However, I can't seem to access 'Application' from basic class objects (ie. standalone .cs files). I read somewhere to use a slight variations in .cs files, as follows, but it always comes throws an exception when in use: …
我发现我使用了很多连接查询,尤其是从我的数据库中获取有关用户操作的统计信息.像这样的查询并不罕见:
from io in db._Owners where io.tenantId == tenantId
join i in db._Instances on io.instanceId equals i.instanceId
join m in db._Machines on i.machineId equals m.machineId
select ...
Run Code Online (Sandbox Code Playgroud)
我的应用程序仍然不活跃,所以我无法判断这些查询在现实生活中是否会在计算上受到限制.我的查询: