예제 #1
0
bool RecvEventsTh::GetConfig(const char * setupfile)
{
	TMemIniFile *ini = new TMemIniFile( setupfile );
	try
	{
		// 判断是否存在插件的设置,没有的话返回false以便系统能够生成默认的设置
		if( ini->SectionExists(PLUGINNAME) == false ) return false;

		SvrIp            = ini->ReadString (PLUGINNAME,"SvrIP",SvrIp);
		PushPort          = ini->ReadInteger(PLUGINNAME,"PushPort",PushPort);
		debug_mode       = ini->ReadBool(PLUGINNAME,"debug_mode",debug_mode);
		JysID            =ini->ReadString (PLUGINNAME,"jysID",JysID);
	}
	__finally
	{
		delete ini;
	}
	return true;
}
예제 #2
0
bool TTrdItf_DDABOSS::GetConfig(void)
{
	if( FSetupFile== NULL ) return false;

	TMemIniFile *ini = new TMemIniFile( FSetupFile );
	try
	{
		// 判断是否存在插件的设置,没有的话返回false以便系统能够生成默认的设置
		if( ini->SectionExists(PLUGINNAME) == false ) return false;
		lstrcpyn(FSet.pUser,ini->ReadString(PLUGINNAME,"pUser",FSet.pUser).c_str(),9);
		lstrcpyn(FSet.pWtfs,ini->ReadString(PLUGINNAME,"pWtfs",FSet.pWtfs).c_str(),2);
		lstrcpyn(FSet.pYyb,ini->ReadString(PLUGINNAME,"pYyb",FSet.pYyb).c_str(),9);
		lstrcpyn(FSet.pRight,ini->ReadString(PLUGINNAME,"pRight",FSet.pRight).c_str(),99);
		lstrcpyn(FSet.pDest,ini->ReadString(PLUGINNAME,"pDest",FSet.pDest).c_str(),49);
		lstrcpyn(FSet.pRemote,ini->ReadString(PLUGINNAME,"pRemote",FSet.pRemote).c_str(),99);
	}
	__finally
	{
		delete ini;
	}
	return true;
}