【VC开源代码栏目提醒】:网学会员在VC开源代码频道为大家收集整理了DataService_ini.cpp提供大家参考,希望对大家有所帮助!
// DataService_ini.cpp: implementation of the DataService_ini class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Login.h"
#include "DataService_ini.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
DataService_ini::DataService_ini()
{
}
DataService_ini::~DataService_ini()
{
}
bool DataService_ini::GetPassword(CString *UserName, CString *Password)
{
//根据用户名得到密码
DWORD nCount = ::GetPrivateProfileString("UserInfo", UserName->GetBuffer(UserName->GetLength()), "", Password->GetBuffer(255), 255, "User.ini");
//释放缓冲区
UserName->ReleaseBuffer();
Password->ReleaseBuffer();
//如果得到的密码的长度为0,返回false,否则返回true
if (nCount == 0)
{
return false;
}
else
{
return true;
}
}
上一篇:
E重新登录.frm
下一篇:
临床前药物安全性评价中毒性病理学新技术的应用