读写ini文件的两个函数

WritePrivateProfileString();//写入
WritePrivateProfileString(string section,string key,string val,string filePath);
参数解释
section  小结名
key 关键字
val 值
filePath 文件路径

GetPrivateProfileString();//读取
GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
参数解释
section  小结名
key 关键字
def 指定条目没找到的时返回的默认值
retVal   指定的字符缓冲区
size     retVal缓冲区最大字符数量
filePath 文件路径
使用的时候需要引入
using System.Runtime.InteropServices;

代码示例
 temp.ToString();
        }

相关文章:

  • 2021-05-22
  • 2022-01-12
  • 2021-10-10
  • 2021-12-30
  • 2021-06-06
  • 2021-06-28
猜你喜欢
  • 2021-08-24
  • 2022-12-23
  • 2021-06-20
相关资源
相似解决方案