Delphi

Delphi10.3读取JSON数组
Delphi

Delphi10.3读取JSON数组

112 0

一、Delphi读取JSON数组是非常方便的,首先我们网上找一段JSON数据复制代码{ "error": 0, "status": "success", "date": "2014-03-04", "results": [{ "currentCity": "成都", "weather_data": [{ "d

Delphi

Delphi DLL 字符串传递例子

63 0

Delphi DLL 字符串传递例子library EN;uses SysUtils, Classes, UnitFormEN in 'UnitFormEN.pas' {FormEN};{$R *.res}function GetJobType(p: PChar): Boolean; stdcall;var str: string;begin str := '我们是中国人,我们爱自己的祖国.'; StrCopy(p, PChar(str)); Result

Delphi

Delphi access 数据库压缩

54 0

//uses ComObj; function compressDB(Afile:string):boolean; // var DaoVar: OLEVariant; begin try DaoVar := CreateOleObject('dao.DBEngine.36'); if FileExists('db.tmp') then deletefile('db.tmp'); // DaoVar.CompactDatabase(afi

Delphi

Delphi 取得和设置当前系统的短日期格式

42 0

// 取得当前系统的短日期格式;function GetsysDateFormat: string;var sgs: string;begin SetLength(sgs, 12); GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_SSHORTDATE, Pchar(sgs), 12); Result := string(Pchar(sgs));end;// 设定系日期格式;procedure SetSysDateFormat(s: string);beg

Delphi

Delphi 动态加载删除字体

30 0

procedure sys_AddFont(fontFileName: string);begin AddFontResource(Pchar(fontFileName)); SendMessage(Application.Handle, WM_FONTCHANGE, 0, 0);end;procedure sys_RemoveFont(fontFileName: string);begin RemoveFontResource(Pchar(fontFileName)); SendMessage

Delphi

Delphi 动态注册卸载OCX

33 0

uses ActiveX;{$R *.dfm}function RegisterOCX(FileName: string): Boolean;var OCXHand: THandle; RegFunc: TDllRegisterServer;begin OCXHand := LoadLibrary(Pchar(FileName)); RegFunc := GetProcAddress(OCXHand, 'DllRegisterServer'); if @RegFunc <

Delphi

Delphi 获取文件创建时间,修改时间,最后

51 0

function GetFileLastAccessTime(FileName: string; AFlag: Integer): TDateTime;var WFD: TWin32FindData; FileTime: TFileTime; hFile: THandle; DFT: DWORD;begin hFile := FindFirstFile(Pchar(FileName), WFD); if hFile <> INVALID_HANDLE_VALUE then be