用户网络聊天,确定谁在线,并定位特定会话?

发布于 2024-07-29 02:20:21 字数 244 浏览 0 评论 0原文

首先,我使用的是.net 3.5。 我想为我的用户创建一个在线聊天系统。 我找到了一些可以使用的不错的(开源)聊天系统,但我想添加一些功能。 我希望聊天用户能够看到有多少人在他们的网站上,并允许聊天用户选择一个用户并开始与他们交谈。 普通用户可能并不总是在该网站上拥有帐户,因此我无法通过我的用户数据库进行精确定位。 我见过其他应用程序允许您从在线用户列表中进行选择并开始与他们聊天。 我想我可以通过会话 ID 来定位,但是有没有更完整的证明方法可以实现这一点?

First, I am using .net 3.5. I want to create an online chat system for my users. I have found some decent (open source) chat systems that I can use, but there are a couple features I want to add. I want the chat user to be able to see how many people are on their site and allow the chat user to select a user and begin to talk with them. The normal user may not always have an account on the site, so I can't pin-point by my user database. I have seen other applications allow you to select from a list of online users and begin a chat session with them. I am thinking I can target by the session ID, but is there a more full proof way I can achieve this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

黄昏下泛黄的笔记 2024-08-05 02:20:21

您可以尝试使用 HttpRequest.AnonymousID 属性:

AnonymousId 属性为未经身份验证的用户分配一个长期存在的唯一标识符,该标识符可用于跟踪用户或向该用户分配配置文件属性,而无需在 Session 对象中存储数据。 默认情况下,AnonymousId 属性是使用 cookie 进行跟踪的。

You can try using HttpRequest.AnonymousID Property:

The AnonymousId property assigns a long-lived unique identifier to a non-authenticated user, which can be used to track the user or assign profile properties to that user without storing data in a Session object. By default, the AnonymousId property is tracked using a cookie.

梦回旧景 2024-08-05 02:20:21

一种方法是在数据库中创建一个新表,用户一登录聊天就会被放入其中 - 即使非会员也可以通过这种方式获得帮助,因为他们可能需要一些别名不管怎样,所以当他们进入聊天室时,他们要么必须选择一个名字,要么随机获得一个名字——这个名字可以链接到一个只在聊天室中出现的ID,用它你可以轻松地与某人开始对话。
这只是一个总体想法,而不是一些解决方案,但我认为你应该能够从那里开始工作。

One way to do this is to make a new table in your database, in which a user is put as soon as he logs in to the chat - even non-members can be helped this way, as they will probably need to have some alias anyway, so when they come into the chat, they either have to choose a name or get one randomly - this name can be linked to an id that only goes in the chatroom, with which you can easily start conversations to someone.
It's just a general idea, rather something worked out, but I think you should be able to work from there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文