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

📄 处理文件夹.txt

📁 解析email的源代码。 mine协议 解码译码
💻 TXT
字号:
vector<string> GetAllNewMail(string mailDir)
{
	vector<string> MailVec;
	int num=0;
	string tempfile;
	WIN32_FIND_DATA FindFileData;
	HANDLE hFind;
	BOOL result,fFinished = FALSE;
	string strPath = mailDir+"\\";
	string strFileEx;
	strFileEx = strPath+"*.txt";
	hFind = FindFirstFile( strFileEx.c_str(),&FindFileData );
	if( hFind == INVALID_HANDLE_VALUE )
		cerr<<"Error: there is no .txt files in this directory!"<<endl;
	else
	{
		num++;
		tempfile = FindFileData.cFileName;
		MailVec.push_back( tempfile );
	}
	while( !fFinished )
	{
		result = FindNextFile( hFind, &FindFileData );
		if( !result )
		{			
			if (GetLastError() == ERROR_NO_MORE_FILES) 
			{								
				cout<<"There are total "<<num<<" new mail to classify!"<<endl;
				fFinished = TRUE; 
			} 
			else 
			{ 
				cerr<<"Couldn't find next file."<<endl; 
			} 
		}
		else
		{
			num++;
			tempfile = FindFileData.cFileName;
			MailVec.push_back( tempfile );
		}
	}
	return MailVec;
} 

⌨️ 快捷键说明

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