如何知道用户在线没有数据库? [英] How to know user is online without database?

查看:73
本文介绍了如何知道用户在线没有数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用户登录后,用户名/用户名将存储在Session中.会话存储在用户的计算机上.我需要在员工登录后获取employeeid才能插入数据库中名为Order的表中.意味着客户访问我的网站可以看到employeeid现在在线.我不想为其创建表或列

After the user logs on, username/userid will be stored in Session.Session is stored on the user''s computer.I need to get employeeid after the employee logged on to insert into table named Order in the database.I mean customers visit my site can see employeeid is online now.I do not want to create a table or column for it

推荐答案

该会话将保留有关每个员工的信息独立地.我建议您创建一个Application变量,每当一名员工登录时,即在session.start中将其用户名添加到Application变量中(类似列表)(同样,在这里您可能必须使用DB来检查用户有效性).一旦多个员工联机,应用程序变量将包含其所有姓名.

现在,当客户登录时,请使用此应用程序变量并向其显示已登录的员工姓名.

让我知道我的理解是否正确.我会完善我的答案.

编辑-我正在谈论的应用程序易变是状态管理技术,它将允许您保存一些将由所有用户访问的值.有关详细信息,请查阅msdn文档.并查看本文以获得粗略的想法-初学者"有关ASP.NET状态管理的教程 [ ^ ]
The session will keep the information about each employee independently. i suggest you create an Application variable, whenever an employee logs in i.e. in session.start add his username to the Application variable(sort of list)(also, here you might have to dip in DB to check the user validity). once multiple employees are online the application variable will contain all their names.

now when a customer logs in, use this application variable and show the logged in employees names to him.

Let me know if my understanding is not correct. i will refine my answer.

EDIT - The Application valriable I am talking about is the state management technique which will allow you to save some values which will be accessed by all the users. check out msdn documentation for details. and see this article to get a cursory idea - A Beginner''s Tutorial on ASP.NET State Management[^]


这篇关于如何知道用户在线没有数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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