Delphi
2022-11-18
266
unit Unit1;interfaceuses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, IdTCPConnection, IdTCPClient, IdHTTP, IdBaseComponent, IdComponent, IdIOHandler, IdIOHandle
2022-11-18
66
procedure TForm1.FormCreate(Sender: TObject);varstartTime: Cardinal;beginstartTime := GetTickCount;Sleep(10);Label1.Caption := '耗时: ' + (GetTickCount - startTime).ToString;end;Delphi 计算运行耗时的方法2http://www.delphitop.com/html/shijian/4382.html
2022-11-18
26
function SuiJiString(const AWeiShu: Integer): string;const SourceStr: string = '金木水火土日月阴阳水火风雷';var MyRep: string; I: Integer;begin Randomize; for I := 1 to AWeiShu do begin //这里只所以必须加1,是因为SourceStr是从1开始的,而Random是从0开始的,SourceStr[0]就会报错,So
2022-11-18
81
function SuiJiString(const AWeiShu: Integer): string;const SourceStr: string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';var MyRep: string; I: Integer;begin Randomize; for I := 1 to AWeiShu do begin //这里只所以必须加1,是因为
2022-11-18
68
url protocol让浏览器运行本地的EXE程序。例如:点击浏览器的一个下载链接,就会打开本地的迅雷。1)注册表注册Windows Registry Editor Version 5.00[HKEY_CLASSES_ROOT\yn]"URL Protocol"="D:\\1.exe"@="WebshellProtocol"[HKEY_CLASSES_ROOT\yn\DefaultIcon]@="D:\\1.exe,1"[
2022-11-18
64
DELPHI控件升级1)DELPHI里面卸载旧版控件;2)WINDOWS里面卸载旧版控件;3)删除旧版控件所在安装文件夹;4)删除旧版的DCU,DCP,BPL文件;5)安装新版控件;6)程序换用新版控件的BPL文件;7)用新版控件,DELPHI编译源码,报错? 关于项目中换用控件新版本 用DELPHI开发项目,免不了会使用三方控件。开发的时候,使用一个版本的控件,后面维护的时候,可能这个控件升级了,推出了新版本的控件。我们就会想着在自己的项目中换用新控件,换了之后,一编译却往往会报错。如下图的错误:别看
2022-11-18
34
uses System.Hash;procedure TForm1.FormCreate(Sender: TObject);beginForm1.Caption:=THash.GetRandomString(32);end;
2022-11-18
87
如果要拦截TAB键行为,应该捕获 CM_DIALOGKEY 消息。在这里示例中,如果将 YouWantToInterceptTab 布尔值设置为 true,则将会吃掉 TAB 键:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) private