12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- #include "stdafx.h"
- #include "dbserver.h"
- #include "InputCode.h"
- #include "my32.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- InputCode::InputCode(CWnd* pParent )
- : CDialog(InputCode::IDD, pParent)
- {
-
- m_code = _T("");
-
- }
- void InputCode::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
-
- DDX_Text(pDX, IDC_EDIT1, m_code);
-
- }
- BEGIN_MESSAGE_MAP(InputCode, CDialog)
-
-
- END_MESSAGE_MAP()
- void InputCode::OnOK()
- {
- UpdateData();
- DWORD code=atoi(m_code);
- code^=0x19900101;
- DWORD id;
- TCHAR DevicePath[ 260];
- if(FindPort(0,DevicePath)!=0)return;
- int version;
- GetIDVersion(&id, &version, DevicePath);
- if(id!=code)
- {
- MessageBox("验证码错误!");
- return;
- }
- BOOL ret;
- CString str;
- str.Format ("%d", 1);
- char name[32];
- memset(name, 0, 32);
- strcpy(name, str);
-
- ret=YtWriteString (name, 330 ,"E4F08542", "87E5CED0", DevicePath);
- if(ret<=0)
- {
- MessageBox("出错!");
- }
- AfxMessageBox("注册成功! 感谢您的注册, 重启服务器程序和客户端软件生效!", MB_ICONINFORMATION);
- g_bReg=1;
- CDialog::OnOK();
- }
|