Chinaunix首页 | 论坛 | 博客
  • 博客访问: 824611
  • 博文数量: 109
  • 博客积分: 650
  • 博客等级: 上士
  • 技术积分: 1483
  • 用 户 组: 普通用户
  • 注册时间: 2012-03-01 17:29
文章分类

全部博文(109)

文章存档

2016年(5)

2015年(21)

2014年(16)

2013年(38)

2012年(29)

分类: LINUX

2013-03-16 10:09:12

[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
阅读(589) | 评论(0) | 转发(0) |
0

上一篇:C++ 学习之路

下一篇:DHCP服务配置2

给主人留下些什么吧!~~