⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 login.cpp

📁 短信发送工具
💻 CPP
字号:
// LOGIN.cpp : implementation file
//

#include "stdafx.h"
#include "SMS.h"
#include "LOGIN.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern BOOL isSuper;
/////////////////////////////////////////////////////////////////////////////
// CLOGIN dialog


CLOGIN::CLOGIN(CWnd* pParent /*=NULL*/)
	: CDialog(CLOGIN::IDD, pParent)
{
	//{{AFX_DATA_INIT(CLOGIN)
	m_user = _T("");
	//}}AFX_DATA_INIT
}


void CLOGIN::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CLOGIN)
	DDX_Text(pDX, IDC_EDIT1, m_user);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CLOGIN, CDialog)
	//{{AFX_MSG_MAP(CLOGIN)
	ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
	ON_BN_CLICKED(IDOK, Onclick)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CLOGIN message handlers






BOOL CLOGIN::OnInitDialog()
{
   CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	((CEdit*)GetDlgItem(IDC_EDIT1))->SetLimitText(50);
   
	
	// Set Caption Font
	//CFont m_Font;
   
        

	return TRUE;
}





void CLOGIN::OnButton2() 
{
	if(MessageBox("真的要退出系统吗?","退出询问",MB_OKCANCEL|MB_ICONQUESTION)==IDOK)
	  OnCancel();
	// TODO: Add your control notification handler code here
	
}

void CLOGIN::Onclick() 
{
		CString m_user;
		CString quanxian;
	CEdit* pEdit=(CEdit*) this->GetDlgItem(IDC_EDIT1);
	  
	pEdit->GetWindowText(m_user);

	if ( ""==m_user)
	{
		AfxMessageBox(_T("请填写本人手机短号"), MB_ICONEXCLAMATION);
        return;
	}
		
	_variant_t Holder, Holder1,Holder2,strQuery;
    strQuery = "select * from user_Info where duanhao='"+m_user+"'";
	theApp.ADOExecute(theApp.m_pADOSet, strQuery);
	int iCount = theApp.m_pADOSet->GetRecordCount();
	if ( 0==iCount ) 
	{
	
		AfxMessageBox("没有这个用户,请重新输入用户名", MB_OK|MB_ICONWARNING);	
	    pEdit->SetWindowText("");
	    pEdit->SetFocus();
	}
	else{	theApp.m_pADOSet->MoveFirst();
    Holder=theApp.m_pADOSet->GetCollect("name");
	theApp.m_sCurrentUser=(Holder.vt==VT_NULL?"":(char*)(_bstr_t)Holder);
    Holder1=theApp.m_pADOSet->GetCollect("changhao");
	theApp.mobile[0]=(Holder1.vt==VT_NULL?"":(char*)(_bstr_t)Holder1);
	Holder2=theApp.m_pADOSet->GetCollect("popedom");
	quanxian=(Holder2.vt==VT_NULL?"":(char*)(_bstr_t)Holder2);
               if (quanxian == "超级用户")
				{					
					isSuper=true;
				}
			   else	if (quanxian == "一般用户")
				{
					isSuper=false;
				}
	
		OnOK();
	}

	 // TODO: Add your control notification handler code here
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -