/// <summary> /// /// </summary> /// <param name="username">用户名</param> /// <param name="way">连接方式,可以是COMX,或WIFI</param> public UserPanel(string username,WifiServer wifiServer) { InitializeComponent(); this.userName = username; this.connnectionWay = "WIFI"; this.userNameLabel.Text = userName; this.ConnectionWayLabel.Text = connnectionWay; this.wifiServer = wifiServer; }
//注册局域网服务器事件 private void initWifiServerEvents() { wifiServer = new WifiServer(Config.SERVER_IP, Config.SERVER_PORT); wifiServer.serverStartEvent += new EventHandler(wifiServer_serverStartEvent); wifiServer.serverCloseEvent += new EventHandler(wifiServer_serverCloseEvent); wifiServer.msgReceivedEvent += new EventHandler<MessageEventArgs>(wifiServer_msgReceivedEvent); wifiServer.clientConnectEvent += new EventHandler<ClientConnectEventArgs>(wifiServer_clientConnectEvent); }