日期:2014-05-20  浏览次数:20740 次

关于GetHashCode用法
需要做一个能转发在线用户列表的聊天服务器 以下各句代码的具体作用是什么呢?2001表示登陆成功。还望各位给我指点下,能否在重点代码上加个注释?? 
foreach (ClientService item in clietn)
                                {
                                    if (item.mysock.GetHashCode() == model.TcpClientHashCode)
                                    {
                                        item.SendMessage(loginState);                                        
                                        if (loginState == "2001")
                                        {
                                            foreach (OnlineModel onLineItem in onlineList)
                                            {
                                                if (onLineItem.TcpClientHashCode != model.TcpClientHashCode)
                                                {
                                                    string userId = onLineItem.UserId.ToString();
                                                    while (true)
                                                    {