随笔分类 - delphi
1
delphi technology
摘要:unit Unit1;interfaceuses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, V...
阅读全文
摘要:单元IdHashSHA申明function GetFile_SHA1(const iFileName: String): String; //Checksum hash value for firefox var SHA1 : TIdHashSHA1; fileStre...
阅读全文
摘要:procedure TForm1.N11DrawItem(Sender: TObject; ACanvas: TCanvas; ARect: TRect; Selected: Boolean);beginIf (Selected) ThenbeginACanvas.Font.Color := clW...
阅读全文
摘要:unit Unit1;interfaceuses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls,Registry,ShlObj;type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declara
阅读全文
摘要:1 添加单元IniFiles2 申明变量为文件流 protectFile:TFileStream;3 protect 路径const = 'c:\xo.ini';4 用独占方式打开 protectFile:=TFileStream.Create(protect,fmShareExclusive);5 释放 protectFile.Free;
阅读全文
摘要:library 系统钩子;uses System.SysUtils, windows, System.Classes;{$R *.res}var //定义全局变量hHook:integer;function HookProc(iCode: Integer; //处理系统钩子的函数wParam: WPARAM;lParam: LPARAM): LRESULT; stdcall; export; //书写调用规则,记得加 stdcallbegin Result := 0;//注意返回值必须为0,允许对窗口的操作 try if iCode = HCBT_DESTROYWND then begin//
阅读全文
摘要:在uses 申明 Inifiles MyStream:TMemIniFile; MyStream:=TMemIniFile.Create('c:\proxy.ini'); memo1.Text:=MyStream.readstring('gae','appid',''); MyStream.Free; 读取'c:\proxy.ini' 文件appid 字符串MemIniFile 能有效 解决 TiniFILE读取数据限制的问题!
阅读全文
摘要:functionRC4(Expression,Password:string):string;varRB:array[0..255]ofInteger;X,Y,Z:longint;Key:arrayofbyte;ByteArray:arrayofWord;//原来delphi7下面是byte;Temp:byte;Counter:integer;beginIf(Length(Expression)=0)thenExit;If(Length(Password)=0)thenExit;If(Length(Password)>256)thenbeginPassword:=Copy(Passwor
阅读全文
摘要: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) Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(
阅读全文
摘要:function CheckTask(ExeFileName: string): Boolean;constPROCESS_TERMINATE=$0001;varContinueLoop: BOOL;FSnapshotHandle: THandle;FProcessEntry32: TProcessEntry32;beginresult := False;FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);FProcessEntry32.dwSize := Sizeof(FProcessEntry32);Conti
阅读全文
摘要:在使用google code 的时候 做个备份,git clone https://wushuangzilong@code.google.com/p/maplebanana-proxy/git config --global user.email "wushuangzilong@gmail.com"git config --global user.name "wushuangzilong@gmail.com"git add *git commit -m "update" *git push origin
阅读全文
摘要:unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, StdCtrls, ExtActns, ComCtrls;typeTForm1 = class(TForm)ProgressBar1: TProgressBar;Label1: TLabel;Button1: TButton;procedure FormCreate(Sender: TObject);procedure Button1Click(Sender: TObject);pr
阅读全文
摘要: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) test: TMemo; Button1: TButton; Memo1: TMemo; Label1: TLabel; procedure Button1Click(Sender: TObject)
阅读全文
摘要:https://raw.github.com/onionhacker/bananaproxy/master/update.ini
阅读全文
摘要:使用Delphi读取网络上的txt和html文件可以使用两种方法:1.下载文件,然后进行读取下载文件的Delphi代码可以参考:http://www.delphibbs.com/delphibbs/dispq.asp?lid=35149532.使用TIdHTTP控件直接读取:使用TIdHTTP的Get方法读取http://192.168.198.1/a.txt,可以这样写:var IdHTTP1: TIdHTTP;string x :=IdHTTP1.Get('http://192.168.198.1/a.txt');
阅读全文
摘要:unit Unit1;interfaceuses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,winsock, Vcl.StdCtrls;type TForm1 = class(TForm) Edit1: TEdit; Edit2: TEdit; Button1: TButton; procedure Button1Click(Sender: TObject); proce
阅读全文
摘要:一、工具选择在 Delphi 中使用正则表达式, 目前 PerlRegEx 应该是首选, 准备彻底而细致地研究它.官方网站: http://www.regular-expressions.info/delphi.html直接下载: http://www.regular-expressions.info/download/TPerlRegEx.zip二、安装方法:1、先把解压的 TPerlRegEx 文件夹放一个合适的地方, 我放在了 Delphi 的 Imports 目录中.2、目前最新 For Win32 的版本是对 Delphi 2006 的, 2007 也能用.
阅读全文
摘要:+ //dos 仿真程序 delphi 窗体实现! function GetDosOutput(CommandLine: string; Work: string = 'C:\'): string; var SA: TSecurityAttributes; SI: TStartupInfo; PI: TProcessInformation; StdOutPipeRead, StdOutPipeWrite: THandle; WasOK: Boolean; Buffer: array[0..255] of AnsiChar; BytesRead: Cardinal; Work..
阅读全文
摘要:delphi托盘程序Delphi的托盘编程 。现在很多程序都用这个,比如傲游,迅雷等,主要代码如下:usesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, ShellAPI, AppEvnts, StdCtrls, Menus;const WM_NID = WM_User + 1000; //声明一个常量private { Private declarations } // 定义两个函数 procedure SysCommand(var SysMsg: TMessage);..
阅读全文
摘要:Delphi程序必须在资源里面嵌入MANIFEST信息 一、 首先编辑一个文件,内容如下: 保存为UAC.manifest,这里文件是随意的。特别注意红色的“requireAdministrator”,这个表示程序需要管理员(Administrator)才能正常运行。二 、然后编辑一个RC文件,名称为uac.rc 内容为:1 24 UAC.manifest注释: *数字1表示资源编号; *数字24表示资源类型为RTMAINIFEST; *UAC.manifest表示前面的文件名称。三、 用brcc32编译这个rc文件为res文件,如下所示: brcc...
阅读全文
1

浙公网安备 33010602011771号