C++语言 实现登录对话框
来源:互联网 发布:品牌十大评选网络投票 编辑:程序博客网 时间:2024/05/05 15:32
学习笔记转摘于: 蟒蛇软件站 http://www.pythonschool.com/python/list_168_1.html
Login dlg; if(dlg.DoModal()!=IDOK) { OnOK(); }void Login::OnOK() { // TODO: Add extra validation here //CEdit *pEdit1 = (CEdit *)GetDlgItem(IDC_EDIT1); //CEdit *pEdit2 = (CEdit *)GetDlgItem(IDC_EDIT2); //CString e1, e2; //pEdit1->GetWindowText(e1); //pEdit2->GetWindowText(e2); //if(e1=="蟒蛇软件站" && e2 == "pythonschool") //{ // CDialog::OnOK(); //} UpdateData(TRUE); //数据交换 if(m_Name.IsEmpty() || m_Password.IsEmpty()) { MessageBox("用户名或密码不能为空"); return; } num++;
if(num == 3)
{
MessageBox("Password was error three times");
CDialog::OnCancel();
return;
} if(m_Name=="蟒蛇软件站" && m_Password == "pythonschool") { CDialog::OnOK(); } else { MessageBox("用户名或密码不正确"); m_Name = ""; m_Password = ""; UpdateData(FALSE); return; } }BOOL Login::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here CStatic *pStatic1 = (CStatic *)GetDlgItem(IDC_STATIC1); CStatic *pStatic2 = (CStatic *)GetDlgItem(IDC_STATIC2); pStatic1->SetWindowText("用户名:"); pStatic2->SetWindowText("密 码:");
num = 0;
//设置窗口始终在最上面
CRect rect;
GetWindowRect(&rect);
::SetWindowPos(m_hWnd, HWND_TOPMOST, rect.left, rect.top, 0, 0,SWP_NOMOVE||SWP_NOSIZE);
return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE}
- C++语言 实现登录对话框
- Android 登录对话框 实现
- Android 登录对话框 实现
- Android实现登录对话框
- Android 登录对话框 实现
- C语言实现超简单登录认证
- Linux下用C语言实现简单的密码登录
- c语言模拟实现三次密码登录(简单)
- C语言文件读写注册登录功能实现
- C语言实现简单的注册、登录、退出
- js模式对话框实现用户登录
- 实现一个登录对话框 (Android开发)
- JQueryUI dialog实现登录对话框效果
- Android _Android登录对话框实现(1)
- 【mfc】用对话框分页实现用户登录
- 如何实现登录对话框与主对话框切换
- C语言注册登录系统
- C语言 编写登录系统
- MFC 在一个button上画图画的一些方法
- LeetCode Binary Tree Inorder Traversal
- 学生类的输入与输出
- AE二次开发技巧之撤销、重做
- Android Handler学习总结
- C++语言 实现登录对话框
- C++语言 在对话框关闭时弹出确认窗口
- c#文件操作(初学者)
- 谷歌公布各版本Android份额 2.3占半壁江山
- 新C++标准:C++0x教程(三):面向所有开发者的特性(中)
- Quartz CronTrigger最完整配置说明
- 分析shell命令中 >/dev/null 2>&1的语法实现原理
- 全变分
- Flash11 Stage3D游戏《封神无双》制作团队专访