- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
// ...
if (m_parent->GetState() == Disconnected)
{
CString login;
CString password;
m_login.GetWindowText(login);
m_password.GetWindowText(password);
if (login.IsEmpty()
|| password.IsEmpty())
{
::MessageBox(this->m_hWnd, _T("Please enter login and password"), _T("Input error"),MB_OK);
return;
}
if (CheckString(login)
|| CheckString(password))
{
::MessageBox(this->m_hWnd, _T("You have entered unsupported symbol."), _T("Input error"), MB_OK);
m_login.SetWindowText(login);
m_password.SetWindowText(password);
return;
}
SaveConfig();
}
// ...
bool CheckString(CString& string)
{
bool res = false;
CString checked = _T("<>,!()[]{}~`#$%^&*+=/\\\"|;:'");
for (int i = 0; i < checked.GetLength(); ++i)
{
if (string.Find(checked[i]) != -1)
{
res = true;
string = _T("");
break;
}
}
return res;
}