//删除键值
procedure MyIni_DeleteKey(MySection,MyIdent:string);
begin
Myini:=TIniFile.Create(IniFilename);
Myini.DeleteKey(MySection,MyIdent);
Myini.Free;
end;
//删除段
procedure MyIni_EraseSection(MySection:string);
begin
Myini:=TIniFile.Create(IniFilename);
Myini.EraseSection(MySection);
Myini.Free;
end;
//读取Bool值
function MyIni_ReadBool(MySection,MyIdent:string;
MyBool:Boolean):Boolean;
begin
Myini:=TIniFile.Create(IniFilename);
Result:=Myini.ReadBool(MySection,MyIdent,MyBool);
Myini.Free;
end;
//读取Integer值
function MyIni_ReadInteger(MySection,MyIdent:string;
MyInteger:Integer):Integer;
begin
Myini:=TIniFile.Create(IniFilename);
Result:=Myini.ReadInteger(MySection,MyIdent,MyInteger);
Myini.Free;
end;
//读取字符串值
function MyIni_ReadString(MySection,MyIdent:string;
MyString:String):Pchar;
begin
Myini:=TIniFile.Create(IniFilename);
Result:=Pchar(Myini.ReadString(MySection,MyIdent,MyString));
Myini.Free;
end;
//写入Bool值
procedure MyIni_WriteBool(MySection,MyIdent:string;
MyBool:Boolean);
begin
Myini:=TIniFile.Create(IniFilename);
Myini.WriteBool(MySection,MyIdent,MyBool);
Myini.Free;
end;
//写入Integer值
procedure MyIni_WriteInteger(MySection,MyIdent:string;
MyInteger:Integer);
begin
Myini:=TIniFile.Create(IniFilename);
Myini.WriteInteger(MySection,MyIdent,MyInteger);
Myini.Free;
end;
//写入String值
procedure MyIni_WriteString(MySection,MyIdent:string;
MyString:String);
begin
Myini:=TIniFile.Create(IniFilename);
Myini.WriteString(MySection,MyIdent,MyString);
Myini.Free;
end;