Backup/Tsr.Common/INIFile.cs
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace Tsr.Common
{
public class INIFile
{
public string path;
public INIFile(string INIPath)
{
this.path = INIPath;
}
public void ClearAllSection()
{
this.IniWriteValue(null, null, null);
}
public void ClearSection(string Section)
{
this.IniWriteValue(Section, null, null);
}
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section, string key, string defVal, byte[] retVal, int size, string filePath);
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
[DllImport("kernel32")]
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
public string IniReadValue(string Section, string Key)
{
StringBuilder retVal = new StringBuilder(0xff);
GetPrivateProfileString(Section, Key, "", retVal, 0xff, this.path);
return retVal.ToString();
}
public byte[] IniReadValues(string section, string key)
{
byte[] retVal = new byte[0xff];
GetPrivateProfileString(section, key, "", retVal, 0xff, this.path);
return retVal;
}
public void IniWriteValue(string Section, string Key, string Value)
{
WritePrivateProfileString(Section, Key, Value, this.path);
}
后面还有 20 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
