怎样写配置文件?

解决方案 »

  1.   

    1. WritePrivateProfileString("test ini", "name", "HKer_007", "e:\\Test.ini"); // 建立并写ini
    2. GetPrivateProfileString("test ini","name","默认值",buf,50,"e:\\Test.ini"); // 读ini中的char..
    3. GetPrivateProfileInt("test ini", "age", 10, "e:\\Test.ini"); // 读ini中的int型值
    参数解释:
    1: 字段名
    2: 变量/键值名
    3: (1) 键值       (2) 默认值     (3) 默认值
    4: (1) 全路径名   (2) 缓冲区名   (3) 全路径名
    5: (2) 缓冲区大小
    6: (2) 全路径名