1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/xiaoyutou_647-wechat-auto-reply-robot

Клонировать/Скачать
IniHelper.cs 1.1 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
煙花綻放過後只剩黑暗 Отправлено 22.04.2021 05:49 7b5b5fa
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();
}
}
}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/xiaoyutou_647-wechat-auto-reply-robot.git
git@api.gitlife.ru:oschina-mirror/xiaoyutou_647-wechat-auto-reply-robot.git
oschina-mirror
xiaoyutou_647-wechat-auto-reply-robot
xiaoyutou_647-wechat-auto-reply-robot
master