usingprofile.cpp
来自「我自己整理的一些VC源代码」· C++ 代码 · 共 74 行
CPP
74 行
// UsingProfile.cpp: implementation of the CUsingProfile class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "SellMan.h"
#include "UsingProfile.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CUsingProfile::CUsingProfile()
{
}
CUsingProfile::~CUsingProfile()
{
}
CUsingProfile::CUsingProfile(LPCTSTR fileName)
{
m_strFileName = fileName;
}
CUsingProfile::CUsingProfile( LPCTSTR fileName, LPCTSTR szAppName )
{
m_strFileName = fileName;
m_strAppName = szAppName;
}
void CUsingProfile::SetFileName(LPCTSTR fileName)
{
m_strFileName = fileName;
}
void CUsingProfile::WriteString(LPCTSTR keyName, LPCTSTR szkeyValue)
{
WritePrivateProfileString( m_strAppName, keyName, szkeyValue, m_strFileName);
}
void CUsingProfile::WriteInt(LPCTSTR keyName, int nKeyValue)
{
CString strKeyValue;
strKeyValue.Format( "%d", nKeyValue );
WritePrivateProfileString( m_strAppName, keyName, strKeyValue, m_strFileName);
}
CString CUsingProfile::GetString(LPCTSTR keyName)
{
CString strKeyValue;
GetPrivateProfileString( m_strAppName, keyName, NULL, strKeyValue.GetBuffer(128), 128, m_strFileName );
strKeyValue.ReleaseBuffer();
return strKeyValue;
}
int CUsingProfile::GetInt(LPCTSTR keyName)
{
return GetPrivateProfileInt( m_strAppName, keyName, 0, m_strFileName );
}
void CUsingProfile::SetAppName(LPCTSTR szAppName)
{
m_strAppName = szAppName;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?