当前位置: 首页>>代码示例>>C++>>正文


C++ CData::GetCurPath方法代码示例

本文整理汇总了C++中CData::GetCurPath方法的典型用法代码示例。如果您正苦于以下问题:C++ CData::GetCurPath方法的具体用法?C++ CData::GetCurPath怎么用?C++ CData::GetCurPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CData的用法示例。


在下文中一共展示了CData::GetCurPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SMT_ChnagLinkFileToUpFile

/*=================================================================
* Function ID :  SMT_ChnagLinkFileToUpFile
* Input       :  void
* Output      :  void
* Author      :  
* Date        :  2006  2
* Return	  :  void
* Description :  将各个链路的数据文件转移到上传的目录下
* Notice	  : 
*=================================================================*/
bool CSmartCommunicationDlg::SMT_ChnagLinkFileToUpFile(char *sYearMonth)
{	
	bool			bFlag=false;
	int				nRet=0;
	char			 szDir[256],sCurPath[256];
	CString			 strFile;	
	CFileFind		 ff;
    char			 sCurFileName[256];	
	char			 sUpPath[256];
	char			 sTmp[256],sBuf[256];
	CData			 cData;
	vector<CString>  VFileName;
	int  nLinkCount=g_VLinkIP.size();

	memset(sBuf,   0,sizeof sBuf);
	memset(sTmp,   0,sizeof sTmp);
	memset(sUpPath,0,sizeof sUpPath);
	memset(szDir,  0,sizeof szDir);
	memset(sCurFileName,0,sizeof sCurFileName);
	memset(sCurPath,0,sizeof sCurPath);
	
	strcpy(sCurPath,cData.GetCurPath());
	strcpy(sUpPath,sCurPath);
	strcat(sUpPath,"\\Deal\\");
	for( int i=0; i<nLinkCount; i++ )
	{
		memset(sTmp, 0,sizeof sTmp);
		memset(szDir,0,sizeof szDir);
		strcpy(szDir,sCurPath);
		strcat(szDir,"\\Log\\");
		memcpy(szDir+strlen(szDir),sYearMonth,6);
		strcat(szDir,"\\");
		strcat(szDir,g_VLinkIP[i].cIP);
		strcpy(sCurFileName,szDir);
		strcat(szDir,"\\Data*.*");
		BOOL res=ff.FindFile(szDir);   
 		while(res)
		{
			memset(sTmp,0,sizeof sTmp);
			memset(sBuf,0,sizeof sBuf);
			res=ff.FindNextFile();
			strFile=ff.GetFileName();
			if(ff.IsDirectory() &&!ff.IsDots())   
			{
				continue;
			}   
			if( strFile=="." || strFile=="..")
			{
				continue;
			}
			strcpy(sTmp,sUpPath);
			strcat(sTmp,strFile);
			strcpy(sBuf,sCurFileName);
			strcat(sBuf,"\\");
			strcat(sBuf,strFile);
			nRet=rename(sBuf,sTmp);
			bFlag=true;
		}
		ff.Close();
	}
	return bFlag;
}
开发者ID:nykma,项目名称:ykt4sungard,代码行数:72,代码来源:SmartCommunicationDlg.cpp

示例2: Init

bool CSmartCommunicationDlg::Init()
{
	char		CurPath[256],CreatePath[256],CurDate[30];
	CData		mData;
	char		buf[128],str[8];
	FileBase	mfile;
	DWORD		nTime=0;
	int			nLen=0;

	memset(g_sCommRec,		   0,sizeof g_sCommRec);
	memset(&g_IniFilePara,     0,sizeof g_IniFilePara);
	memset(g_PathIniFileName,  0,sizeof g_PathIniFileName);
	memset(g_SaveBlackList,    0,sizeof g_SaveBlackList);
	memset(g_SaveAssistantList,0,sizeof g_SaveAssistantList);

	memset(str,			0x00,sizeof str);
	memset(CurDate,		0x00,sizeof CurDate);
	memset(m_DealPath,  0x00,sizeof m_DealPath);
	memset(CurPath,		0x00,sizeof CurPath);
	memset(CreatePath,	0x00,sizeof CreatePath);
	memset(m_ErrMsg,	0x00,sizeof m_ErrMsg);
	memset(m_CurPath,	0x00,sizeof m_CurPath);
	strcpy(CurPath,mData.GetCurPath());
	memcpy(CurDate,mData.GetSysTime(),6);

	
	g_nSaveAssistantVer=0;
	g_WriteFileLock    =false;		//文件锁

	g_VLinkIP.clear();
	strcpy(g_sCommRec,CurPath);
	strcat(g_sCommRec,"\\SmartCommRec.ini");

	//上传交易数据明细
	strcpy(m_DealPath,CurPath);
	strcat(m_DealPath,"\\Deal");
	CreateDirectory(m_DealPath,NULL);
	
	strcpy(g_PathIniFileName,CurPath);
	strcat(g_PathIniFileName,"\\system.ini");
	//日志路径
	memset(CreatePath,0x00,sizeof CreatePath);	
	strcpy(CreatePath,CurPath);
	strcat(CreatePath,"\\Log");
	CreateDirectory(CreatePath,NULL);
	strcat(CreatePath,"\\");
	strcat(CreatePath,CurDate);
	CreateDirectory(CreatePath,NULL);
	strcpy(m_CurPath,CreatePath);
	//系统日志
	strcat(CreatePath,"\\Sys");
	CreateDirectory(CreatePath,NULL);

	if( !g_VSmartPos.empty())		g_VSmartPos.clear();	
	if( !g_LTcpsmart.empty())		g_LTcpsmart.clear();

	nRateDeveice			   = 0;
	m_BtRate.EnableWindow(FALSE);	
	m_edit_devicetotal.SetWindowText("");	
	m_edit_devicerate.SetWindowText("");	
	m_edit_devicesuccess.SetWindowText("");	
	

	//延时时间1
	memset(buf,0,sizeof buf);
	mfile.GetProfileStr("system.ini","SLEEP","TIME1",buf);
	mData.trim(buf);
	if( !strlen(buf) )  SMT_WAITFORTIME1=35;
	else				SMT_WAITFORTIME1=atol(buf);

	//延时时间2
	memset(buf,0,sizeof buf);
	mfile.GetProfileStr("system.ini","SLEEP","TIME2",buf);
	mData.trim(buf);
	if( !strlen(buf) )  SMT_WAITFORTIME2=25;
	else				SMT_WAITFORTIME2=atol(buf);
	
	//延时时间3
	memset(buf,0,sizeof buf);
	mfile.GetProfileStr("system.ini","SLEEP","TIME3",buf);
	mData.trim(buf);
	if( !strlen(buf) )  SMT_WAITFORTIME3=350;
	else				SMT_WAITFORTIME3=atol(buf);
	
	//调试日志开关
	memset(buf,0,sizeof buf);
	mfile.GetProfileStr("system.ini","SLEEP","LOG",buf);
	mData.trim(buf);
	if( !strlen(buf) )  g_IniFilePara.bWriteDebugLog=false;
	else				g_IniFilePara.bWriteDebugLog=true;
	
	memset(buf,0,sizeof buf);
	mfile.GetProfileStr("system.ini","MONEY","MAX",buf);
	mData.trim(buf);
	//记录上传的时间间隔
	memset(buf,0,sizeof buf);
	mfile.GetProfileStr("system.ini","SLEEP","UPRECORD",buf);
	mData.trim(buf);
	g_IniFilePara.lUpRecordWaitTime=atol(buf);
	if( g_IniFilePara.lUpRecordWaitTime<=0 )
//.........这里部分代码省略.........
开发者ID:nykma,项目名称:ykt4sungard,代码行数:101,代码来源:SmartCommunicationDlg.cpp


注:本文中的CData::GetCurPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。