用户在此网络聊天应用程序中输入错误的房间 [英] users enter wrong rooms in this web chat application

查看:71
本文介绍了用户在此网络聊天应用程序中输入错误的房间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在研究此Web聊天应用程序,使用构建Web聊天应用程序来构建Web聊天应用程序. ASP.Net 3.5,LINQ和AJAX(在C#3.5或VB 9.0中) [ ^ ],但总有一个问题,我尝试了很多解决却没有希望.

即:我有特定的房间,每个房间都指定给某些用户,以便一个房间中的用户可以一起聊天,而其他房间中的人看不到它们.
问题是用户输入错误的房间!

尽管它们被定向到正确的房间,但是它们的名称被添加到错误的房间列表中!

我使用了与之前链接中相同的代码,并对其进行了测试,它也存在相同的问题!

拜托,谁能帮我.

I''ve been working on this web chat application Build a Web Chat Application using Build a Web Chat Application using ASP.Net 3.5, LINQ and AJAX (in C# 3.5 or VB 9.0)[^] but there''s always a problem I tried a lot to solve but no hope.

Which is: I have specific rooms and each room is specified to certain users so that users in one room can talk together without people in other rooms can see them.
The problem is that users enter wrong rooms!

Although they are directed to the right room, their names are added to the wrong room list!

I used the same code as in the link before and I tested it and it has the same problem!

Please, can anyone help me.

推荐答案

112 if(user == null)
113 {
114 LoggedInUser loggingInUser = new LoggedInUser();
115 loggingInUser.UserID = Convert.ToInt32(Session ["ChatUserID"]);
116 loggingInUser.RoomID = Convert.ToInt32(lblRoomId.Text);
117分贝.LoggedInUsers.InsertOnSubmit(loggedInUser);
118分贝.SubmitChanges();
119}

如果您使用了文章中的代码并重定向到另一个Roomid(在演示中的查询字符串上),但又忘记将第116行(上方)更新为正确的Roomid,则可能会引起您所描述的问题. (注意:它是从表单值而不是会话值中获取ID)是吗? :)
112 if (user == null)
113 {
114 LoggedInUser loggedInUser = new LoggedInUser();
115 loggedInUser.UserID = Convert.ToInt32(Session["ChatUserID"]);
116 loggedInUser.RoomID = Convert.ToInt32(lblRoomId.Text);
117 db.LoggedInUsers.InsertOnSubmit(loggedInUser);
118 db.SubmitChanges();
119 }

If you used the code from the article and redirected to a different roomid (on the querystring in the demo), but you forgot to update line 116 (above) to the correct roomid, that would cause the problem you describe. (note: it''s taking the id from a form value instead of the session value) That it? :)


这篇关于用户在此网络聊天应用程序中输入错误的房间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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