C#读写INI配置文件
来源:互联网 发布:matlab 矩阵正交化 编辑:程序博客网 时间:2024/05/17 09:17
引进
using System.Collections.Specialized;
//Define API function for write and read the INI file
[DllImport("kernel32")]
//此为写入
private static extern bool WritePrivateProfileString(string section, string key, string val, string filePath);
//此为读出
//GetPrivateProfileString("节名","Name","没有获得匹配",s,len(s),你那ini的路径);
private static extern int GetPrivateProfileString(string section, string key, string def, byte[] retVal, int size, string filePath);
请注意读出来的是一个int型的数。所以需要换转,下面给出程序转换片断例子:
int length = GetPrivateProfileString("分類", arrCode[i], "", byBuffer, byBuffer.GetUpperBound(0), filePath);
if (length != 0)
{
string str = Encoding.GetEncoding(0).GetString(byBuffer);
//string[] strSplit = str.Split('|');
}
- C#读写INI配置文件
- C#读写ini配置文件
- C#读写ini配置文件
- C#读写ini配置文件
- C#读写INI配置文件
- C#读写ini配置文件
- C#中读写INI配置文件
- C#中读写INI配置文件
- C#中读写INI配置文件
- 用C#读写ini配置文件
- 用C#读写ini配置文件
- c# 读写INI配置文件 张宇轩
- 用C#读写ini配置文件
- C# API读写ini配置文件
- 用C#读写ini配置文件
- 用C#读写ini配置文件
- 使用C#读写ini配置文件
- 【转】在C#中读写INI配置文件
- 中国最伤感的2首歌
- nginx常用设置
- 刚使用Active Directory的常见问题
- 刚使用Active Directory的常见问题(2)
- Custom role-dependent user profiles
- C#读写INI配置文件
- Monitoring Clusters With SNMP
- 批量修改域用户登录脚本
- TDD (Test-Driven Development) 全攻略
- 域中打印机共享添加
- 禁止本地用户登陆
- java generic -covariant return type
- VC下判断文件是否存在(转)
- 电脑主机命名规则|活动目录计算机命名规则