[omcbo@DGSERNMC111 test1]$ cat test.cpp
#include
#include
#include
#include
#define ODBCFiles "../configure/ODBCConfig.ini"
/*
typedef struct
{
string User;
string DNS;
string Password;
}ODBCConfig;
*/
using namespace std;
string Readstring(string filename,string Pipei)
{
ifstream infile(filename.c_str());
vector vstr;
string str;
string result_str;
string result_str2;
string:: size_type pos1,pos2;
while (getline(infile,str))
{
vstr.push_back(str);
pos1 = str.find(Pipei);
if (pos1 != string::npos)
{
pos2 = str.find("=");
basic_string str5b(str.begin()+5,str.end());
result_str2=str.substr(pos2+1,str.length());
cout<
}
}
return result_str2;
}
int main()
{
cout<
return 0;
}
[omcbo@DGSERNMC111 test1]$ g++ test.cpp -o test1
[omcbo@DGSERNMC111 test1]$ ./test1
DGDC
DGDC
[omcbo@DGSERNMC111 test1]$ cat ../configure/ODBCConfig.ini
[ODBCINFO]
DNS=DGDC
USER=DGDCDW
PASSWORD=DGDCDW_123
阅读(963) | 评论(0) | 转发(0) |