delphi 根据文件扩展名判断文件类型函数写法
function IsImageFile(const fn: string): Boolean;var extfn:String;begin extfn := LowerCase(ExtractFileExt(fn)); Result := (extfn = '.jpg') or (extfn = '.jpeg') or (extfn = '.gif') or (extfn =
function IsImageFile(const fn: string): Boolean;var extfn:String;begin extfn := LowerCase(ExtractFileExt(fn)); Result := (extfn = '.jpg') or (extfn = '.jpeg') or (extfn = '.gif') or (extfn =
unit Unit1;interfaceuses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;type TForm1 = class(TForm) Memo1: TMemo; Memo2: TMemo; Button1: TButt
function GetLastName(const fn: string): string;var i:Integer; s:string;begin s := trim(fn); if s[Length(s)]='\' then s := Copy(s,1,Length(s)-1); while Pos('\',s)>0 do begin i := Pos('\',s); s := Copy(s,i+1,Length
//线程TThread.CreateAnonymousThread( procedure begin //内容 end //此处无分号 ).Start;//同步 TThread.Synchronize(nil, procedure begin // end);――――――――――――――――原文链接:https://blog.csdn.net/ozhy111/article/details/82957751
procedure TForm2.FormCreate(Sender: TObject);begin perform(WM_SIZE,SIZE_MAXIMIZED,0);end;
unit Unit1;interfaceuses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs;type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); private { Private d
varLg: TLogs;Lg := TLogs.Create('_sql.log');Lg.Log('日志内容');Lg.Destroy();unit TLog;interfaceusesWindows, Messages, SysUtils, Classes, Graphics, Controls, Forms,Dialogs, StdCtrls;type TLogs = class private FileName: string; public
unit Unit1;interfaceuses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs;type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); private { Private d