Unit unit1;interfaceuses Windows, Messages, sysutils, variants, Classes, Graphics, Controls, Forms, Dialogs, Stdctrls,in Ifiles, Grids, extctrls, Buttons;type TForm1 = Class (Tform) Btn1:tbutton; Btn2:tbutton; Bvl1:tbevel; Strngrd:tstringgrid; BTN3:TBITBTN; Procedure Btn1click (Sender:tobject); Procedure Btn2click (Sender:tobject); Procedure Formcreate (Sender:tobject); Procedure Strngrdgeteditmask (Sender:tobject; Acol, Arow:integer; var value:string); Procedure Btn3click (Sender:tobject); Private {Private declarations} public {public declarations} path:string; Function Readonepara (sinifile,sct,idt:string): String; Procedure Writeonepara (sinifile,sct,idt,value:string); End;var form1:tform1;implementation{$R *.dfm}procedure tform1.btn1click (sender:tobject); begin WriteOnePara (path+ ' Basic configuration. TAB ', ' SHUTDOWN ', ' chkhintmusic ', ' ddalf '); Writeonepara (path+ ' basic configuration. TAB ', ' Shutdown Time ', ' Music ', ' 1313 '); Writeonepara (path+ ' basic configuration. TAB ', ' Desktop video ', ' CHktmusic ', ' fdasf455 '); Writeonepara (path+ ' basic configuration. TAB ', ' service config ', ' chk ', ' Is it true '); end;procedure Tform1.btn2click (Sender:tobject); var s:string;begin s:=readonepara (path+ ' Basic configuration. TAB ', ' SHUTDOWN ', ' chkhintmusic '); ShowMessage (s); S:=readonepara (path+ ' basic configuration. TAB ', ' Shut down time ', ' Music '); ShowMessage (s); S:=readonepara (path+ ' basic configuration. TAB ', ' Desktop video ', ' Chktmusic '); ShowMessage (s); S:=readonepara (path+ ' basic configuration. TAB ', ' service configuration ', ' chk '); ShowMessage (s); End;function Tform1.readonepara (Sinifile, SCT, idt:string): String; Var ainifile:tinifile;begin result:= '; Ainifile:=tinifile.create (Sinifile); Try Result:=ainifile.readstring (Sct,idt, "); Finally Ainifile.free; End;end;procedure Tform1.writeonepara (Sinifile, Sct, Idt, value:string); Var ainifile:tinifile;begin ainifile:=tinifile.create (sinifile); Try Ainifile.writestring (Sct,idt,value); Finally Ainifile.free; End;end;procedure tform1.formcreate (sender:tobject); begin Path:=extractfilepath (application.exename); end; Procedure Tform1.strngrdgeteditmask (SendEr:tobject; Acol, Arow:integer; value:string var); begin value:= ' 00:00:00 '; end;procedure Tform1.btn3click (sender:tobject); Begin STRNGRD. cells[0,0]:= ' serial number '; Strngrd. cells[1,0]:= ' Shutdown time '; Strngrd. cells[2,0]:= ' boot time '; Strngrd. Cells[3,0]:= ' give '; end;end.
Operation tab file and Tstringgrid assignment;