public void InitAllControlValues(bool bUpdate) { nFlag = 0; if (bUpdate) { TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "资料注册成功", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK); //MessageBoxCommon.Show("조작이 성공하였습니다.", MessageBoxType.Ok); } if (!string.IsNullOrEmpty(Login._UserInfo.strAccountID)) { this.txtBankAccountID.Text = Login._UserInfo.strAccountID; } if (!string.IsNullOrEmpty(Login._UserInfo.strAccountNumber)) { this.txtBankAccountNumber.Text = Login._UserInfo.strAccountNumber; } if (!string.IsNullOrEmpty(Login._UserInfo.strAccountID) && !string.IsNullOrEmpty(Login._UserInfo.strAccountNumber)) { nFlag = 1; this.txtBankAccountID.IsEnabled = false; this.txtBankAccountNumber.IsEnabled = false; this.lblPassword1.Content = "原始密码"; this.lblPassword2.Content = "新密码"; this.btnSaveOrChange.Content = "变更"; } }
private void delBt_Click(object sender, RoutedEventArgs e) { //if (letterDataGrid.SelectedIndex < 0) // return; SendData sendData = (SendData)letterDataGrid.SelectedItem; TempWindowForm tempWindowForm = new TempWindowForm(); if (sendData == null) { QQMessageBox.Show(tempWindowForm, "请选择需要删除的题目", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK); return; } if (QQMessageBox.Show(tempWindowForm, "您确定要删除吗?", "提示", QQMessageBoxIcon.Question, QQMessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.Cancel) { return; } Login._BoardInfo.Id = sendData.id; if (Main.notice_board == true) { Login._ClientEngine.Send(NotifyType.Request_DelNotice, Login._BoardInfo); } else { Login._ClientEngine.Send(NotifyType.Request_DelLetter, Login._BoardInfo); } }
public void NotifyOccured(NotifyType notifyType, Socket socket, BaseInfo baseInfo) { switch (notifyType) { case NotifyType.Reply_UpdateUser: { UserInfo userName = (UserInfo)baseInfo; Login._UserInfo.Point = userName.Point; gridRight.Visibility = Visibility.Hidden; backGrid.Visibility = Visibility.Visible; ChatClient.Home_MyInfo.ConvPointToCash convPointToCash = new Home_MyInfo.ConvPointToCash(); backGrid.Children.Clear(); backGrid.Children.Add(convPointToCash); TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "更新成功", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK); } break; case NotifyType.Reply_UserInfo: { Login._UserInfo = (UserInfo)baseInfo; this.txtCashAmount.Content = Login._UserInfo.Cash.ToString(); this.txtChangingMoney.Content = (Login._UserInfo.Cash / 100 * 90).ToString(); } break; } }
void item2_Click(object sender, RoutedEventArgs e) { //if (MessageBoxCommon.Show("您确定要删除吗?", MessageBoxType.YesNo) == MessageBoxReply.No) // return; TempWindowForm tempWindowForm = new TempWindowForm(); if (QQMessageBox.Show(tempWindowForm, "您确定要删除吗?", "提示", QQMessageBoxIcon.Question, QQMessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.Cancel) { return; } var selectMenu = sender as MenuItem; string imgIcon = selectMenu.DataContext.ToString(); if (imgIcon == Login._UserInfo.Icon) { QQMessageBox.Show(tempWindowForm, "已设定在头像的图片不能删除.", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK); //MessageBoxCommon.Show("已设定在头像的图片不能删除.", MessageBoxType.Ok); } else { for (int i = 0; i < Login.myhome.iconInfoList.Count; i++) { if (imgIcon == System.Windows.Forms.Application.StartupPath + "\\" + Login.myhome.iconInfoList[i].Icon.Replace("/", "\\")) { Login._ClientEngine.Send(NotifyType.Request_IconRemove, Login.myhome.iconInfoList[i]); break; } } } }
private void open_MouseDown(object sender, MouseButtonEventArgs e) { _LoadWorker = new BackgroundWorker(); _LoadWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.LoadWorker_DoWork); _LoadWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_LoadWorker_RunWorkerCompleted); Microsoft.Win32.OpenFileDialog ofd = new Microsoft.Win32.OpenFileDialog(); ofd.Filter = "mp3 (*.mp3)|*.mp3|wma (*.wma)|*.wma"; Nullable <bool> result = ofd.ShowDialog(); if (result == true) { System.IO.FileInfo fileSize = new System.IO.FileInfo(ofd.FileName); if (fileSize.Length > 5000000) { //MessageBoxCommon.Show("Overflow mp3 Size.", MessageBoxType.Ok); //return; TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "Overflow mp3 Size.", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK); } char[] delimiterChars = { ':', '\\' }; string[] words = ofd.FileName.Split(delimiterChars); int count = words.Length; musicname = words[count - 1].ToString(); string filename = ofd.FileName; lstMediaItems.Items.Add(musicname); musicList.Add(filename); _LoadWorker.RunWorkerAsync(); } }
private void Update_Room(object sender, RoutedEventArgs e) { // IniFileEdit iniFileEdit = new IniFileEdit(Login._UserPath); // string strPrice = System.Text.RegularExpressions.Regex.Replace(roomPrice.Text, @"[0-9]", ""); // string strMaxUser = System.Text.RegularExpressions.Regex.Replace(maxUser.Text, @"[0-9]", ""); //if (strPrice.Length > 0 && strMaxUser.Length > 0) // MessageBoxCommon.Show(iniFileEdit.GetIniValue("StringMessageBox", "Invalid_Number"), MessageBoxType.Ok); //else //{ if (roomPass.Password == veriPass.Password) { Login._RoomInfo.Name = roomBox.Text; //방이름 Login._RoomInfo.Id = selectRoomId; Login._RoomInfo.Kind = 0; //if (roomPrice.Text == "") Login._RoomInfo.Cash = 0; //else // Login._RoomInfo.Cash = Convert.ToInt32(roomPrice.Text); //if (maxUser.Text == "") Login._RoomInfo.MaxUsers = 0; //else // Login._RoomInfo.MaxUsers = Convert.ToInt32(maxUser.Text); Login._RoomInfo.Owner = roomUpowner; Login._RoomInfo.RoomPass = roomPass.Password; Login._ClientEngine.Send(NotifyType.Request_UpdateRoom, Login._RoomInfo); this.Close(); //} } else { TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "암호가 일치하지 않습니다.", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK); } }
private void btnPayment_Click(object sender, System.Windows.RoutedEventArgs e) { int nChangeMoney = Login._UserInfo.Cash / 100 * 90; nInputChangeMoney = 0; if (!this.txtBankAccountNumber.Text.Equals(Login._UserInfo.strAccountNumber)) { //MessageBoxCommon.Show("계좌번호가 일치하지 않습니다.", MessageBoxType.Ok); TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "계좌번호가 일치하지 않습니다.", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK); this.txtBankAccountNumber.Text = string.Empty; this.txtBankAccountNumber.Focus(); return; } if (!this.txtBankAccountID.Text.Equals(Login._UserInfo.strAccountID)) { //MessageBoxCommon.Show("계좌아이디가 일치하지 않습니다.", MessageBoxType.Ok); TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "계좌아이디가 일치하지 않습니다.", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK); this.txtBankAccountID.Text = string.Empty; this.txtBankAccountID.Focus(); return; } try { nInputChangeMoney = Convert.ToInt32(this.txtChangeMoney.Text); if (nInputChangeMoney > nChangeMoney) { //MessageBoxCommon.Show("변한금액량이 너무 많습니다.", MessageBoxType.Ok); TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "结算金额有误请重新输入", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK); this.txtChangeMoney.Text = string.Empty; this.txtChangeMoney.Focus(); return; } if (!this.txtPassword.Password.Equals(Login._UserInfo.strAccountPass)) { //MessageBoxCommon.Show("비밀번호가 일치하지 않습니다.", MessageBoxType.Ok); TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "次输入密码有误请重新输入", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK); this.txtPassword.Password = string.Empty; this.txtPassword.Focus(); return; } } catch (System.Exception) { //MessageBoxCommon.Show("변환금액을 정확히 입력해주세요.", MessageBoxType.Ok); TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "结算金额有误请重新输入", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK); return; } RequestPaymentToServer(); }
private void EnterGame(int nGameType) { if (Main.activeGame != null) { TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "你必须选择一个游戏", "提示", QQMessageBoxIcon.Warning, QQMessageBoxButtons.OK); return; } // modified by usc at 2014/02/09 if (Main.m_bGameRunning) { return; } //if (_gameInfo.Source != "Dice" && nGameType == 0) //{ // TempWindowForm tempWindowForm = new TempWindowForm(); // QQMessageBox.Show(tempWindowForm, "游戏测试中...", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK); // return; //} GameInfo enterGameinfo = new GameInfo(); enterGameinfo._NotifyHandler = _gameInfo._NotifyHandler; enterGameinfo.Bank = _gameInfo.Bank; enterGameinfo.Commission = _gameInfo.Commission; enterGameinfo.GameId = (Convert.ToInt32(_gameInfo.GameId) + nGameType).ToString(); enterGameinfo.GameName = _gameInfo.GameName; enterGameinfo.Height = _gameInfo.Height; enterGameinfo.Icon = _gameInfo.Icon; enterGameinfo.nCashOrPointGame = nGameType; enterGameinfo.Source = _gameInfo.Source; enterGameinfo.UserCount = _gameInfo.UserCount; enterGameinfo.Width = _gameInfo.Width; Login._UserInfo.GameId = enterGameinfo.GameId; Login._UserInfo.nCashOrPointGame = enterGameinfo.nCashOrPointGame; Main.m_bGameRunning = true; Dispatcher.BeginInvoke(new System.Threading.ThreadStart(delegate { if (Main.loadWnd == null) { Main.loadWnd = new LoadingWnd(); Main.loadWnd.Owner = Main.GetParentWindow(this); Main.loadWnd.ShowDialog(); } })); Login._ClientEngine.Send(NotifyType.Request_EnterGame, enterGameinfo); }
private void Button_Click(object sender, RoutedEventArgs e) { _bChanged = true; if (userNicname.Text == "") { //MessageBoxCommon.Show("请输入您的称号.", MessageBoxType.Ok); TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "请输入您的称号.", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK); } else { Login._UserInfo.Id = userId.Content.ToString(); Login._UserInfo.Nickname = userNicname.Text; Login._UserInfo.Address = userEmailAddress.Text; Login._UserInfo.Sign = signBox.Text; if (Login._UserInfo.Kind == (int)UserKind.ServiceWoman) { if (this.chkAllGuest.IsChecked == true) { Login._UserInfo.nVIP = 1; } else { Login._UserInfo.nVIP = 0; } } try { Login._UserInfo.Year = Convert.ToInt32(userYear.SelectedItem.ToString()); Login._UserInfo.Month = Convert.ToInt32(userMonth.SelectedItem.ToString()); Login._UserInfo.Day = Convert.ToInt32(userDay.SelectedItem.ToString()); } catch (Exception) { } //if(!rePass.Password.Equals(Login._UserInfo.Password)) //{ // TempWindowForm tempWindowForm = new TempWindowForm(); // QQMessageBox.Show(tempWindowForm, "原始密码输入有误.", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK); // return; //} //if (!CheckPassword(newPass.Password, userId.Content.ToString())) //{ // return; //} //Login._UserInfo.Password = newPass.Password; Login._ClientEngine.Send(NotifyType.Request_UpdateUser, Login._UserInfo); } }
private void okBt_Click(object sender, RoutedEventArgs e) { if (_veriPass == passwordRoom.Password) { Login._ClientEngine.Send(NotifyType.Request_EnterRoom, verifyRoomInfo); this.Close(); } else { TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "암호가 틀립니다.", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK); } }
private void viewBt_Click(object sender, RoutedEventArgs e) { if (letterDataGrid.SelectedIndex < 0) { TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "请选择需要删除的题目", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK); return; } SendData selectedFile = (SendData)letterDataGrid.Items[letterDataGrid.SelectedIndex]; nSelectId = selectedFile.id; if (Main.notice_board == true) { for (int i = 0; i < Login._HomeInfo.Notices.Count; i++) { if (Login._HomeInfo.Notices[i].Id == nSelectId) { Main.writeSend = new WriteSend(); Main.writeSend.title.Text = Login._HomeInfo.Notices[i].Title; Main.writeSend.contents.Text = Login._HomeInfo.Notices[i].Content; Main.writeSend.title.IsReadOnly = true; Main.writeSend.contents.IsReadOnly = true; Main.writeSend.btFlag = false; Main.writeSend.Show(); } } Login._BoardInfo.Id = nSelectId; Login._ClientEngine.Send(NotifyType.Request_ReadNotice, Login._BoardInfo); } else { for (int i = 0; i < Login.noticeList.Count; i++) { if (Login.noticeList[i].Id == nSelectId) { Main.writeSend = new WriteSend(); Main.writeSend.title.Text = Login.noticeList[i].Title; Main.writeSend.contents.Text = Login.noticeList[i].Content; Main.writeSend.title.IsReadOnly = true; Main.writeSend.contents.IsReadOnly = true; Main.writeSend.btFlag = false; Main.writeSend.Show(); } } } }
public void NotifyOccured(NotifyType notifyType, Socket socket, BaseInfo baseInfo) { switch (notifyType) { case NotifyType.Reply_PaymentInfo: { //MessageBoxCommon.Show("조작이 성공하였습니다.", MessageBoxType.Ok); TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "结算成功", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK); this.txtChangeMoney.Text = ""; this.txtPassword.Password = ""; } break; } }
private void button1_Click(object sender, RoutedEventArgs e) { Login._AskChatInfo.TargetId = reciveId; Login._AskChatInfo.Agree = 1; if (Login._UserInfo.Cash > Login._AskChatInfo.Price) { Login._ClientEngine.Send(ChatEngine.NotifyType.Request_GameList, Login._UserInfo); Login._ClientEngine.Send(ChatEngine.NotifyType.Reply_EnterMeeting, Login._AskChatInfo); } else { TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "您的余额不足不能进行聊天.", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK); } this.Close(); }
private void roomDelete_MouseUp(object sender, MouseButtonEventArgs e) { if (_roomGrid == true) { _roomGrid = true; TempWindowForm tempWindowForm = new TempWindowForm(); if (QQMessageBox.Show(tempWindowForm, "Are you sure?", "提示", QQMessageBoxIcon.Question, QQMessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.Cancel) { return; } _roomInfo.Id = _roomId; Login._ClientEngine.Send(NotifyType.Request_DelRoom, _roomInfo); } }
public Login() { InitializeComponent(); this.SetLanguageDictionary(); InitSetting(); InitMainResourceDic(); // WindowStyle Setting CheckUpdate(); _ClientEngine = new Client(InvokeSocket); if (!_ClientEngine.Connect(_ServerUri, _ServerPort, ProtocolType.Tcp)) { TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "服务器连接失败", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK); Environment.Exit(0); } _ClientEngine.AttachHandler(NotifyOccured); StartTimer(); ImageBrush myIconImg = new ImageBrush(); myIconImg.Stretch = Stretch.Fill; icon = _IniFileEdit.GetIniValue("UserInfo", "userImage"); BitmapImage bi = new BitmapImage(); bi.BeginInit(); bi.UriSource = new Uri(icon, UriKind.RelativeOrAbsolute); bi.EndInit(); myIconImg.ImageSource = ImageDownloader.GetInstance().GetImage(icon); logimg.Fill = myIconImg; txtUserName.Focus(); // 2014-06-15: GreenRose DeleteDataFolder(); }
private void goRegistor_Click(object sender, RoutedEventArgs e) { //IniFileEdit iniFileEdit = new IniFileEdit(Login._UserPath); //string strPrice = System.Text.RegularExpressions.Regex.Replace(roomPass.Password, @"[0-9]", ""); //string strMaxUser = System.Text.RegularExpressions.Regex.Replace(veriPass.Password, @"[0-9]", ""); //if (strPrice.Length > 0 || strMaxUser.Length > 0) //{ // MessageBoxCommon.Show(iniFileEdit.GetIniValue("StringMessageBox", "Invalid_Number"), MessageBoxType.Ok); // return; //} //else //{ if (roomPass.Password == veriPass.Password) { RoomInfo roomInfo = new RoomInfo(); roomInfo.Name = roomBox.Text; //방이름 Random userId = new Random(); roomInfo.Id = userId.Next(11111111, 99999999).ToString(); //방아이디 roomInfo.Kind = 0; //방종류 //if (price.Text == "") roomInfo.Cash = 0; //else // roomInfo.Cash = Convert.ToInt32(price.Text); //if (maxUser.Text == "") roomInfo.MaxUsers = 0; //else // roomInfo.MaxUsers = Convert.ToInt32(maxUser.Text); roomInfo.Owner = roomOwner; roomInfo.RoomPass = roomPass.Password; roomInfo.Icon = "Images\\Room\\default.gif"; Login._ClientEngine.Send(NotifyType.Request_MakeRoom, roomInfo); this.Close(); } else { TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "암호가 일치하지 않습니다.", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK); } //} }
private void Button_Click(object sender, RoutedEventArgs e) { if (btFlag == true) { if (title.Text != string.Empty) { string sendNameStr = sendName.Text; char[] delimiterChars = { ',' }; string[] words = sendNameStr.Split(delimiterChars); int count = words.Length; if (words[0].ToString() == "管理人") { Login._BoardInfo.Title = title.Text; Login._BoardInfo.Content = contents.Text; Login._BoardInfo.UserId = Login._UserInfo.Id; Login._BoardInfo.UserKind = Login._UserInfo.Kind; Login._BoardInfo.SendId = "admin"; Login._ClientEngine.Send(NotifyType.Request_SendLetter, Login._BoardInfo); } else { for (int i = 0; i < count; i++) { if (words[i].ToString() != "") { Login._BoardInfo.Title = title.Text; Login._BoardInfo.Content = contents.Text; Login._BoardInfo.UserId = Login._UserInfo.Id; Login._BoardInfo.UserKind = Login._UserInfo.Kind; Login._BoardInfo.SendId = words[i].ToString(); Login._ClientEngine.Send(NotifyType.Request_SendLetter, Login._BoardInfo); } } } } else { TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "请输入标题", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK); } } this.Close(); }
public void NotifyOccured(NotifyType notifyType, Socket socket, BaseInfo baseInfo) { switch (notifyType) { case NotifyType.Reply_NewID: { UserInfo newUserInfo = (UserInfo)baseInfo; TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "帐号申请通过." + newUserInfo.Id + "(首次登陆没有密码 登陆后请完善资料)", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK); userInfoList.Add(newUserInfo); grdFriendIDCreate.Children.Clear(); NoticeMemberControl noticeMemberControl = new NoticeMemberControl(); noticeMemberControl.listMember(userInfoList); grdFriendIDCreate.Children.Add(noticeMemberControl); } break; case NotifyType.Reply_Give: { PresentHistoryInfo presentHistoryInfo = (PresentHistoryInfo)baseInfo; for (int i = 0; i < userInfoList.Count; i++) { if (userInfoList[i].Id == presentHistoryInfo.ReceiveId) { userInfoList[i].Cash = userInfoList[i].Cash + presentHistoryInfo.Cash; grdFriendIDCreate.Children.Clear(); NoticeMemberControl noticeMemberControl = new NoticeMemberControl(); noticeMemberControl.listMember(userInfoList); grdFriendIDCreate.Children.Add(noticeMemberControl); break; } } } break; } }
// 2013-12-12: GreenRose // 패스워드 유효성검사하는 함수 private bool CheckPassword(string strPassword, string strUserID) { try { if (strPassword.Length < 6) { //MessageBoxCommon.Show("비밀번호는 문자, 수자 조합으로 6~16자리로 입력해주세요.", MessageBoxType.Ok); TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "密码由字母和数字组合6-16位 请重新输入", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK); return(false); } System.Text.RegularExpressions.Regex regex1 = new System.Text.RegularExpressions.Regex(@"[a-zA-Z]"); System.Text.RegularExpressions.Regex regex2 = new System.Text.RegularExpressions.Regex(@"[0-9]"); if (!regex1.IsMatch(strPassword) || !regex2.IsMatch(strPassword)) { //MessageBoxCommon.Show("비밀번호는 문자, 수자 조합으로 6~16자리로 입력해주세요.", MessageBoxType.Ok); TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "密码由字母和数字组合6-16位 请重新输入", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK); return(false); } if (strPassword.IndexOf(strUserID) > -1) { //MessageBoxCommon.Show("비밀번호에 아이디를 사용할수 없습니다.", MessageBoxType.Ok); TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "密码不能和ID重复密码过于简单", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK); return(false); } } catch (Exception ex) { string strError = ex.ToString(); ErrorCollection.GetInstance().SetErrorInfo(strError); return(false); } return(true); }
private void button1_Click(object sender, RoutedEventArgs e) { System.Text.RegularExpressions.Regex emailregex = new System.Text.RegularExpressions.Regex(@"[0-9]"); Boolean ismatch = emailregex.IsMatch(textBox1.Text); if (!ismatch) { TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "请把房间价格用数字填写.", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK); } else { Login._AskChatInfo.Agree = 1; Login._AskChatInfo.Price = Convert.ToInt32(textBox1.Text); Login._AskChatInfo.AskContent = textBlock1.Text; Login._AskChatInfo.TargetId = reqId; Login._ClientEngine.Send(ChatEngine.NotifyType.Request_EnterMeeting, Login._AskChatInfo); Login._ClientEngine.Send(ChatEngine.NotifyType.Request_GameList, Login._UserInfo); this.Close(); } }
public void VideoDownloadComplete(string filePath) { //if (Main.loadWnd != null) //{ // Main.loadWnd.Close(); // Main.loadWnd = null; //} FileInfo fileInfo = new FileInfo(filePath); if (fileInfo.Length == 0) { TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "对不起, 没有资料。", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK); } //복호화한다. 2014-2-25 by pakcj //string decPath = WebDownloader.GetInstance().DecryptFile(filePath); string decPath = filePath; Utils.FileExecute(decPath); bClickFlag = false; }
// 2014-04-05: GreenRose // 영상채팅단추를눌렀을경우. private void Button_Click_1(object sender, RoutedEventArgs e) { UserInfo userInfo = GetUserInfoById(_userId); if (userInfo.nVIP == 0) { if (Login._UserInfo.Kind != (int)UserKind.ServiceWoman && Login._UserInfo.nVIP != 1) { TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "只限vip客户使用权限", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK); return; } } try { if (userInfo.nUserState == 20) { TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "1:1聊天进行中...", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK); return; } if (CheckOpened("TempSoloVideoForm")) { //GG.SoloVideoForm soloVideoForm = new GG.SoloVideoForm(Login._UserInfo.Id, _userId, "", false, Main._main); ManVideoFormcs soloVideoForm = new ManVideoFormcs(Login._UserInfo.Id, _userId, "", false, Main._main); soloVideoForm.Text = _userId; soloVideoForm.Tag = "TempSoloVideoForm"; soloVideoForm.Show(); } } catch (Exception) { } }
static public void ShowError(ErrorType errorType) { IniFileEdit iniFileEdit = new IniFileEdit(_UserPath); string errorString = iniFileEdit.GetIniValue("MessageString", errorType.ToString()); if (errorString == "") { return; } else { TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, errorString, "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK); if (errorType == ErrorType.Unknown_User) { Main tempMain = Main._main; if (tempMain != null) { tempMain.ExitProgram(); } } } }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (_AutoClose == false) { TempWindowForm tempWindowForm = new TempWindowForm(); if (QQMessageBox.Show(tempWindowForm, "您想离开游戏吗?", "提示", QQMessageBoxIcon.Question, QQMessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.Cancel) { e.Cancel = true; return; } } // 2014-04-01: GreenRose // 게임방에서 나간상태를 알린다. Login._UserInfo.nUserState = 13; Login._ClientEngine.Send(NotifyType.Request_UserState, Login._UserInfo); _GameView.CloseView(); Main._GameRoom = null; Main.activeGame = null; Main.u_gamrId = null; Login._ClientEngine.Send(NotifyType.Request_OutGame, Login._UserInfo); Login._ClientEngine.DetachHandler(_GameView.NotifyOccured); Login._ClientEngine.DetachHandler(NotifyOccured); Login._ClientEngine.DetachHandler(OnReceive); _GameView.SetFrameWindowProc(null); _GameView.Dispose(); _GameView = null; host.Child = null; }
private void openFile_Click(object sender, RoutedEventArgs e) { //// Create OpenFileDialog //Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); //// Set filter for file extension and default file extension //dlg.Filter = "JPEG Files (*.jpeg)|*.jpeg|PNG Files (*.png)|*.png|JPG Files (*.jpg)|*.jpg|GIF Files (*.gif)|*.gif"; //Nullable<bool> result = dlg.ShowDialog(); //// Get the selected file name and display in a TextBox //if (result == true) //{ // Image myImg = new Image(); // BitmapImage myBit = new BitmapImage(); // myBit.BeginInit(); // myBit.UriSource = new Uri(dlg.FileName, UriKind.Absolute); // myBit.EndInit(); // /*********************************/ // char[] delimiterChars = { ':', '\\' }; // string[] words = dlg.FileName.Split(delimiterChars); // int count = words.Length; // JpegBitmapEncoder encoder = new JpegBitmapEncoder(); // encoder.Frames.Add(BitmapFrame.Create(myBit)); // byte[] bit = new byte[0]; // using (MemoryStream stream = new MemoryStream()) // { // encoder.Save(stream); // bit = stream.ToArray(); // stream.Close(); // if (bit.Length >= 120000) // { // //MessageBoxCommon.Show("文件过大上传失败.请上传100KB以下的文件.", MessageBoxType.Ok); // TempWindowForm tempWindowForm = new TempWindowForm(); // QQMessageBox.Show(tempWindowForm, "文件过大上传失败.请上传100KB以下的文件.", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK); // } // else // { // VideoInfo videoInfo = new VideoInfo(); // videoInfo.Data = bit; // videoInfo.UserId = words[count - 1].ToString(); // videoInfo.ImgData = bit; // videoInfo.ImgName = words[count - 1].ToString(); // Login._ClientEngine.Send(NotifyType.Request_IconUpload, videoInfo); // } // } // /*************************************/ //} try { System.Windows.Forms.OpenFileDialog fileDialog = new System.Windows.Forms.OpenFileDialog(); fileDialog.Multiselect = false; fileDialog.Filter = "ALL Files (*.*)|*.*|JPEG Files (*.jpeg)|*.jpeg|PNG Files (*.png)|*.png|JPG Files (*.jpg)|*.jpg|GIF Files (*.gif)|*.gif"; fileDialog.Title = "请选择图片文件."; if (System.Windows.Forms.DialogResult.OK == fileDialog.ShowDialog()) { foreach (string fileName in fileDialog.FileNames) { System.IO.FileInfo fileSize = new System.IO.FileInfo(fileName); if (fileSize.Length > 1024 * 10 * 10 * 10 * 10 / 2) { continue; } string strUri = Login._ServerPath; if (strUri[strUri.Length - 1] != '/') { strUri = strUri + "/"; } strUri += "FaceUpload.php"; WebUploader.GetInstance().ctrlAlbum = this; progressUpdate.Visibility = Visibility.Visible; WebUploader.GetInstance().UploadFile(fileName, strUri, FileUploadComplete, this); //if (UpdateFile(fileName)) //{ // byte[] bit = new byte[0]; // VideoInfo videoInfo = new VideoInfo(); // videoInfo.Data = bit; // videoInfo.UserId = Login._UserInfo.Id; // videoInfo.ImgData = bit; // int nIndex = fileName.LastIndexOf("\\"); // videoInfo.ImgName = fileName.Substring(nIndex + 1); // Login._ClientEngine.Send(NotifyType.Request_IconUpload, videoInfo); //} nTotalFileCount++; } if (nTotalFileCount == 0) { TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "文件大小必须小于 5MB.", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK); } } } catch (Exception ex) { string strError = ex.ToString(); ErrorCollection.GetInstance().SetErrorInfo(strError); } }
private bool CheckValidForValues() { try { Convert.ToInt32(this.txtBankAccountNumber.Text); } catch (System.Exception) { //MessageBoxCommon.Show("계좌번호는 수자가 되여야 합니다.", MessageBoxType.Ok); TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "银行帐号请填写正确数字", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK); this.txtBankAccountNumber.Text = string.Empty; this.txtBankAccountNumber.Focus(); return(false); } if (string.IsNullOrEmpty(this.txtBankAccountID.Text)) { //MessageBoxCommon.Show("계좌아이디를 입력하세요.", MessageBoxType.Ok); TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "银行类型 请输入正确帐号", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK); this.txtBankAccountID.Text = string.Empty; this.txtBankAccountID.Focus(); } if (nFlag == 0) { if (!CheckPassword(this.txtPassword.Password, this.txtBankAccountID.Text)) { this.txtPassword.Password = string.Empty; this.txtConfirmPassword.Password = string.Empty; return(false); } if (!this.txtPassword.Password.Equals(this.txtConfirmPassword.Password)) { //MessageBoxCommon.Show("비밀번호가 일치하지 않습니다.", MessageBoxType.Ok); TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "2次输入密码有误请重新输入", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK); this.txtPassword.Password = string.Empty; this.txtConfirmPassword.Password = string.Empty; this.txtPassword.Focus(); return(false); } } else { if (!this.txtPassword.Password.Equals(Login._UserInfo.strAccountPass)) { //MessageBoxCommon.Show("이전암호가 정확하지 않습니다.", MessageBoxType.Ok); TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "原始密码输入有误", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK); this.txtPassword.Password = string.Empty; this.txtConfirmPassword.Password = string.Empty; this.txtPassword.Focus(); return(false); } if (!CheckPassword(this.txtConfirmPassword.Password, this.txtBankAccountID.Text)) { this.txtPassword.Password = string.Empty; this.txtConfirmPassword.Password = string.Empty; return(false); } } return(true); }
private void save_Click(object sender, RoutedEventArgs e) { //string filePath = "C:\\Record\\" + Login._UserInfo.Id + ".avi"; //Microsoft.Win32.OpenFileDialog open = new Microsoft.Win32.OpenFileDialog(); //open.Multiselect = false; //open.FileName = filePath; //open.Filter = "AVI Files (*.avi)|*.avi"; //if ((bool)open.ShowDialog()) //{ // if (filePath == open.FileName) // { // Uploader(open.FileName, open.OpenFile()); // } //} try { //System.Windows.Forms.OpenFileDialog fileDialog = new System.Windows.Forms.OpenFileDialog(); //fileDialog.Multiselect = false; //fileDialog.Filter = "AVI Files (*.avi)|*.avi|WMV Files (*.wmv)|*.wmv|ALL Files (*.*)|*.*"; //fileDialog.Title = "비디오파일선택"; //if (System.Windows.Forms.DialogResult.OK == fileDialog.ShowDialog()) //{ //string fileName = fileDialog.FileName; string fileName = _strRecordFilePath; System.IO.FileInfo fileSize = new System.IO.FileInfo(fileName); if (fileSize.Length > 1024 * 10 * 10 * 10 * 10 / 2) { TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "文件大小必须小于 5MB.", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK); return; } string strImageFile = fileName.Replace(".mp4", ".jpg"); string strUri = Login._ServerPath; if (strUri[strUri.Length - 1] != '/') { strUri = strUri + "/"; } // 2014-02-09: GReenRose Dispatcher.BeginInvoke(new System.Threading.ThreadStart(delegate { if (Main.loadWnd == null) { Main.loadWnd = new LoadingWnd(); Main.loadWnd.Owner = myHome; Main.loadWnd.ShowDialog(); } })); strUri += "FaceUpload.php"; WebUploader.GetInstance().UploadFile(fileName, strUri, FileUploadComplete, this); _strImageFile = strImageFile; _strUri = strUri; //WebUploader.GetInstance().UploadFile(strImageFile, strUri, ImageFileUploadComplete, this); this.Close(); //if (UpdateFile(fileName)) //{ // if (UpdateFile(strImageFile)) // { // byte[] bit = new byte[0]; // VideoInfo videoInfo = new VideoInfo(); // videoInfo.Data = bit; // videoInfo.UserId = Login._UserInfo.Id; // videoInfo.ImgData = bit; // int nIndex = fileName.LastIndexOf("\\"); // videoInfo.ImgName = fileName.Substring(nIndex + 1); // Login._ClientEngine.Send(NotifyType.Request_VideoUpload, videoInfo); // } //} } catch (Exception ex) { string strError = ex.ToString(); ErrorCollection.GetInstance().SetErrorInfo(strError); } }
public void NotifyOccured(NotifyType notifyType, Socket socket, BaseInfo baseInfo) { switch (notifyType) { case NotifyType.Reply_UpdateUser: { UserInfo userName = (UserInfo)baseInfo; Login.main.nickName.Content = userName.Nickname; ToolTip tt = new ToolTip(); tt.Content = userName.Nickname; Login.main.nickName.ToolTip = tt; IniFileEdit _IniFileEdit = new IniFileEdit(Login._UserPath); ImageBrush updateImg = new ImageBrush(); updateImg.Stretch = Stretch.Fill; _IniFileEdit.SetIniValue("UserInfo", "userImage", userName.Icon); BitmapImage bi = new BitmapImage(); bi.BeginInit(); bi.UriSource = new Uri(userName.Icon, UriKind.RelativeOrAbsolute); bi.EndInit(); //updateImg.ImageSource = bi; updateImg.ImageSource = ImageDownloader.GetInstance().GetImage(userName.Icon); myPicture.Fill = updateImg; Login.main.memberImg.Fill = updateImg; ToolTip sign = new ToolTip(); sign.Content = Login._UserInfo.Sign; Login.main.singBox.ToolTip = sign; //Login.main.singBox.Text = Login._UserInfo.Sign; if (selectGrid.Children.Count > 0 && selectGrid.Children[0] is MyInfoControl) { MyInfoControl myInfoControl = (MyInfoControl)selectGrid.Children[0]; myInfoControl.buttonSave.IsEnabled = false; } //MessageBoxCommon.Show("更新成功", MessageBoxType.Ok); TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "更新成功", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK); } break; case NotifyType.Request_VideoUpload: { // 2014-02-09: GreenRose if (Main.loadWnd != null) { Main.loadWnd.Close(); Main.loadWnd = null; } //List<IconInfo> listVideoInfo = new List<IconInfo>(); IconInfo newIcon = (IconInfo)baseInfo; //iconInfoList.Add(newIcon); if (iconInfoList != null) { iconInfoList.Add(newIcon); } else { iconInfoList = new List <IconInfo>(); iconInfoList.Add(newIcon); } selectGrid.Children.Clear(); PictureControl pictureControl = new PictureControl(); pictureControl.InitVideoList(iconInfoList); selectGrid.Children.Add(pictureControl); TempWindowForm tempWindowForm = new TempWindowForm(); QQMessageBox.Show(tempWindowForm, "更新成功", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK); } break; //case NotifyType.Reply_NewID: // { // UserInfo newUserInfo = (UserInfo)baseInfo; // TempWindowForm tempWindowForm = new TempWindowForm(); // QQMessageBox.Show(tempWindowForm, "帐号申请通过." + newUserInfo.Id + "(首次登陆没有密码 登陆后请完善资料)", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK); // userInfoList.Add(newUserInfo); // selectGrid.Children.Clear(); // NoticeMemberControl noticeMemberControl = new NoticeMemberControl(); // noticeMemberControl.listMember(userInfoList); // selectGrid.Children.Add(noticeMemberControl); // } // break; case NotifyType.Reply_IconUpload: { IconInfo newIcon = (IconInfo)baseInfo; IconInfo iconInfo = iconInfoList.Find(item => item.Id == newIcon.Id); if (iconInfo == null) { iconInfoList.Add(newIcon); selectGrid.Children.Clear(); AlbermControl albermControl = new AlbermControl(); albermControl.pictureList(iconInfoList); selectGrid.Children.Add(albermControl); } } break; case NotifyType.Reply_Give: { PresentHistoryInfo presentHistoryInfo = (PresentHistoryInfo)baseInfo; presentHistoryList.Add(presentHistoryInfo); selectGrid.Children.Clear(); InnerControl innerControl = new InnerControl(); innerControl.InnerChatting(chatHistoryList); selectGrid.Children.Add(innerControl); for (int i = 0; i < userInfoList.Count; i++) { if (userInfoList[i].Id == presentHistoryInfo.ReceiveId) { userInfoList[i].Cash = userInfoList[i].Cash + presentHistoryInfo.Cash; selectGrid.Children.Clear(); NoticeMemberControl noticeMemberControl = new NoticeMemberControl(); noticeMemberControl.listMember(userInfoList); selectGrid.Children.Add(noticeMemberControl); break; } } } break; case NotifyType.Reply_UpdatePercent: { UserInfo userPercent = (UserInfo)baseInfo; if (userPercent.Id == Login._UserInfo.Id) { selectGrid.Children.Clear(); MyInfoControl myInfoControl = new MyInfoControl(); myInfoControl.InitMyInfo(Login._UserInfo); selectGrid.Children.Add(myInfoControl); } } break; case NotifyType.Reply_IconRemove: { IconInfo newIcon = (IconInfo)baseInfo; for (int i = 0; i < iconInfoList.Count; i++) { if (iconInfoList[i].Icon == newIcon.Icon) { iconInfoList.Remove(iconInfoList[i]); } } selectGrid.Children.Clear(); AlbermControl albermControl = new AlbermControl(); albermControl.pictureList(iconInfoList); selectGrid.Children.Add(albermControl); } break; case NotifyType.Reply_Error: { ResultInfo errorInfo = (ResultInfo)baseInfo; ErrorType errorType = errorInfo.ErrorType; //Login.ShowError(errorType); } break; } }