Example #1
0
        public frmServer()
        {
            InitializeComponent();
            txtIP.Text   = UdpOp.GetLocalIPAddress();
            serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
            IPEndPoint server = new IPEndPoint(IPAddress.Any, 30000);

            serverSocket.Bind(server);
            this.clientList       = new ArrayList();
            updateStatusDelegate += new UpdateStatusDelegate(showmsg);
        }
Example #2
0
        public bool Login(UserInfo model)
        {
            bool isSuccess = false;
            var  ret       = dal.GetLoginInfoByAccount(model.userAccount);

            if (ret != null)
            {
                if (ret.userPwd == model.userPwd)
                {
                    ret.onLine    = 1;
                    ret.ipAddress = UdpOp.GetLocalIPAddress();
                    dal.UpdateUserInfoLogin(ret);
                    isSuccess = true;
                }
            }
            return(isSuccess);
        }