public LoginForm(DataCenter dataCenterP) { InitializeComponent(); //this.ControlBox = false; dataCenter = dataCenterP; userInfos = dataCenter.GetAllUserInfo(); if (userInfos != null) { foreach (UserInfo userInfo in userInfos) { comboBoxUserName.Items.Add(userInfo.number); } } else { //显示警告 MessageBox.Show("用户名读取错误"); } }