vc操作ini文件

来源:互联网 发布:如何看网络3d蓝光电影 编辑:程序博客网 时间:2024/06/08 17:55

char    FilePath[255];

//获取ini文件名称,保存到FilePath

 

//从ini配置文件中读取字符串

char UserName[MAX_PATH]={0};
 GetPrivateProfileString("info","username","admind",UserName,MAX_PATH,FilePath);

 

//从ini配置文件中读取整数

int port=0;

 port=GetPrivateProfileInt("info","port",1,FilePath);

//往ini文件中写入字符串

::WritePrivateProfileString("info","username",UserName,FilePath);

 

原创粉丝点击