如题.希望能直接通过INIFile操作读写。
解决方案 »
- 通过ADSL 访问远程的MSSQL DB ,一般要做些什么设置或是条件,第三方软件也可?
- dspack 视频采集,视频通道选择的问题
- fastreport 中pascal脚本 ComponentCount 怎么用?
- EHLIB控件需要那些DLL
- 有关QuickReport两个简单问题!
- 窗体的固定(移动)问题?
- 各位,找一个用华表(CELL)做报表设计器
- 求教:如何在程序中根据用户名和密码访问局域网中的计算机.
- 请问有基于Delphi的高校宿舍管理系统的源码吗
- 我想看李维的书
- 请各位帮忙看看这代码有什么问题?为什么我反复大约30次ADO操作的时候会出现“未指定的错误”?
- 使用ADOQuery的问题
[行]
列=值
var
i,j,m,n:Integer;
fl:TINIfile;
path,rowname,colname:string;
begin
path:=ExtractFilePath(application.ExeName);
fl:=TIniFile.Create(path+'param.ini');
i:=self.StringGrid1.RowCount;
m:=self.StringGrid1.ColCount;
fl.WriteInteger('param','rowcount',i-1);
fl.WriteInteger('param','colcount',m);
for n:=0 to m-1 do
begin
self.StringGrid1.Cells[n,0]:='第'+inttostr(n+1)+'列';
colname:=self.StringGrid1.Cells[n,0];
fl.WriteString('colname',IntToStr(n),colname);
for j:=0 to m-1 do
begin
self.StringGrid1.Cells[j,n]:=inttostr(j+1)+'行'+inttostr(n+1)+'列';
rowname:=self.StringGrid1.Cells[j,n];
fl.WriteString('rowname',IntToStr(n)+','+inttostr(j),rowname);
end;
end;
fl.Free;
end;
var
i,j,m,n:Integer;
fl:TINIfile;
path,rowname,colname:string;
begin
path:=ExtractFilePath(application.ExeName);
fl:=TIniFile.Create(path+'param.ini');
i:=fl.ReadInteger('param','rowcount',0);
m:=fl.ReadInteger('param','colcount',0);
if (i=0) or (m=0) then
Exit;
self.StringGrid1.RowCount:=i+1;
self.StringGrid1.ColCount:=m;
for n:=0 to m-1 do
begin
colname:=fl.ReadString('colname',IntToStr(n),'');
Self.StringGrid1.Cells[n,0]:=colname;
for j:=0 to i do
begin
rowname:=fl.ReadString('rowname',IntToStr(n)+','+inttostr(j),'');
self.StringGrid1.Cells[n,j]:=rowname;
end;
end;
fl.Free;
end;