1 Star 0 Fork 31

choufeng2018/微信自动回复机器人

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
IniHelper.cs 1.13 KB
一键复制 编辑 原始数据 按行查看 历史
鱼鱼鱼 提交于 2021-04-22 10:49 +08:00 . no commit message
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace TestWechat
{
public class IniHelper
{
private readonly string _inipath;
public IniHelper(string iniPath)
{
_inipath = iniPath;
}
[DllImport("kernel32")]
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal,
int size, string filePath);
public void IniWriteValue(string section, string key, string value)
{
WritePrivateProfileString(section, key, value, _inipath);
}
public string IniReadValue(string section, string key)
{
var temp = new StringBuilder(500);
var i = GetPrivateProfileString(section, key, "", temp, 500, _inipath);
return temp.ToString();
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/choufeng2018/wechat-auto-reply-robot.git
git@gitee.com:choufeng2018/wechat-auto-reply-robot.git
choufeng2018
wechat-auto-reply-robot
微信自动回复机器人
master

搜索帮助