Delphi

Delphi

Delphi DeleteFiles 删除目录下多个文件

51 0

function DeleteFiles(const Dir, Wildcard: string): Integer;var Files: TStringList; // stores files to be deleted I: Integer; // loops thru files in folder AFile: string; // a file to be deleted Attr: Integer; // attributes of a file

Delphi

Delphi FireDAC 获取 INSERT 记录的自增 ID

109 0

将数据插入具有自动增量字段的数据库表中时的常见模式是使用 SQL 查询来选择新创建的记录的最后插入ID。使用 TFDQuery 运行 INSERT 查询后,您可以运行第二个查询来获取新插入的自动增量 ID。例如,MySQL 具有一个 SELECT 查询函数,您可以运行该函数,称为 LAST_INSERT_ID(),比如:SELECT LAST_INSERT_ID() ,但是,这种方法耦合度太高,不同的数据库,使用的函数也不一样。 FireDAC 提供了一个函数,您可以通过 TFDConnectio

Delphi

Delphi 获取上一次文件访问时间

28 0

上次访问该文件的时间是什么?这是如何编写一个函数的示例,该函数将返回文件的上次访问时间(不要与上次修改时间混淆)。function GetFileLastAccessTime(sFileName: string): TDateTime;var ffd : TWin32FindData; dft : DWord; lft : TFileTime; h : THandle;begin // get file information h := Windows.FindFirstFile(PCh

Delphi

Delphi 对非活动窗口进行屏幕截图

29 0

function WindowSnap(windowHandle: HWND; bmp: TBitmap): boolean;var r: TRect; user32DLLHandle: THandle; printWindowAPI: function(sourceHandle: HWND; destinationHandle: HDC; nFlags: UINT): BOOL; stdcall;begin result := False; user32DLLHandle := Get

Delphi

Delphi 时间年月日,星期

28 0

function NowGMT: TDateTime;var ST: TSystemTime;begin // This Windows API function gets system time in UTC/GMT // see http://msdn.microsoft.com/en-us/library/ms724390 GetSystemTime(ST); Result := SystemTimeToDateTime(ST);end;function RFC1123DateSt

Delphi

Delphi 合并文件

46 0

procedure MergeFiles(const Files: TStrings; const TargetFile: string);var I: Integer; InStm, OutStm: TFileStream;begin OutStm := TFileStream.Create(TargetFile, fmCreate); try for I := 0 to Pred(Files.Count) do begin InStm := TFileStream.Cr

Delphi

delphi中判断字符串是否为数字

64 0

function IsNumber(pcString: PChar): Boolean;begin Result := False; while pcString^ <> #0 do // 0 indicates the end of a PChar string if not (pcString^ in ['0'..'9']) then Exit; Inc(pcString); end; Result := True;end;

Delphi

Delphi 如何检查字符串是否为数字

30 0

function IsNumber(pcString: PChar): Boolean;begin Result := False; while pcString^ <> #0 do // 0 indicates the end of a PChar string if not (pcString^ in ['0'..'9']) then Exit; Inc(pcString); end; Result := True;end;