lazarus 给应用程序创建 配置文件哈哈
procedure TForm1.Button2Click(Sender: TObject);
begin
ForceDirectoriesUTF8(GetAppConfigDirUTF8(False)); ForceDirectoriesUTF8 //C:\Documents and Settings\Administrator\Local Settings\project1
with Sqlite3Dataset1 do
begin
FileName := IncludeTrailingPathDelimiter(GetAppConfigDirUTF8(False )) + ‘data.db‘;
tablename:=‘zmeee‘;
if not TableExists then
begin
FieldDefs.Clear;
FieldDefs.Add(‘Id‘, ftAutoInc);
FieldDefs.Add(‘Name‘, ftString);
FieldDefs.Add(‘Email‘, ftString);
CreateTable;
end;
Open;
end;
end;
时间: 2024-10-12 12:59:20