Delphi

Delphi

Delphi 将listview保存为TXT

23 0

var lList: Tstrings; i: integer;begin lList:= TStringList.Create; try for i:=0 to ListView.Items.Count -1 do LList.add(listview1.items[i].caption + '|' + listview1.items[i].subitems.strings[0] +'|' + listview1.items[i].subi

Delphi

Delphi 提取字符串中所有数字

41 0

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

Delphi

Delphi 验证TStrings是否存在

56 0

function IsPresentInList(strings: TStrings; const value: string): Boolean;var i: Integer;begin Result := False; for i := 0 to strings.Count - 1 do if SameText(strings[i], value) then Exit(True);end;procedure TForm1.Button1Click(Sender: TObject);beginif I

Delphi

Delphi XE可执行文件上启用DEP和ASLR

47 0

Enable DEP and ASLR flags on a Delphi XE+ executable:unit Unit1; //{$SetPEOptFlags $100} //to set the ASLR flag//{$SetPEOptFlags $40} //to set the DEP flag{$SetPEOptFlags $140} //to set both DEP + ASLR in one lineStatically analyze Windows exe files (onl

Delphi

Delphi 通过按键 ESC 关闭程序

39 0

procedure TForm1.FormCreate(Sender: TObject);begin KeyPreview := true;end;procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);begin if Key = #27 then Close;end;

Delphi

Delphi 在长文件名和短文件名之间转换

53 0

uses Windows, SysUtils;function GetShortName(sLongName: string): string;var sShortName : string; nShortNameLen : integer;begin SetLength(sShortName, MAX_PATH); nShortNameLen := GetShortPathName( PChar(sLongName), PChar(sShortName), MAX_PATH -

Delphi

Delphi 更改消息对话框中的按钮标题

44 0

unit Unit2;interfaceuses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;type TForm2 = class(TForm) Memo1: TMemo; Button1: TButton; Edit1: TEd