📄 filereadconfig.cpp
字号:
// FileReadConfig.cpp: implementation of the CFileReadConfig class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "FileReadConfig.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
int CFileReadConfig::m_iFrequency = 794000000;
bool CFileReadConfig::m_bHasRead = false;
CFileReadConfig::CFileReadConfig()
{
}
CFileReadConfig::~CFileReadConfig()
{
}
//返回全路径
CString CFileReadConfig::ReadConfigFile( )
{
CString strReturn = _T("");
CFile file;
CString strFile = _T("OutputConfig.txt");
if( !file.Open( strFile,CFile::modeRead ))
return _T("");
file.SeekToBegin();
WCHAR buf[2];
CString strOneLine = _T("");
CString strText = _T("");
bool bFirst = true;
bool bStart = false;
//下载路径
while(1)
{
memset(buf,0,4);
int iResult = 0;
iResult = file.Read(buf,2);
CString str = CString(buf);
if( str == _T("\r") )
{
iResult = file.Read(buf,2);
break;
}
else
strReturn += str;
}
//频点
CString strFrequency;
while(1)
{
memset(buf,0,4);
int iResult = 0;
iResult = file.Read(buf,2);
CString str = CString(buf);
if( !iResult )
{
CFileReadConfig::m_iFrequency = _wtoi(strFrequency);
break;
}
else
strFrequency += str;
}
file.Close();
CFileReadConfig::m_bHasRead = true;
return strReturn;
}
int CFileReadConfig::ReadFrequency()
{
if( !CFileReadConfig::m_bHasRead )
ReadConfigFile();
return CFileReadConfig::m_iFrequency;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -