delphiËæ»úÊäÈëÑéÖ¤Âë
ÊäÈëÑéÖ¤Âë Ò»¸öÎı¾¿ò 24×ÖĸËæ»ú³ö4¸ö×Öĸ È»ºóÓû§
ÊäÈëËùËæ»ú³öµÄ×Öĸ ÊäÈëÕýÈ· ½øÈë½çÃæ¡£¡£´íÎóÓÖËæ»úÏ¡£¡£¡£
*/
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
lbl1: TLabel;
Edit1: TEdit;
btn1: TButton;
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure btn1Click(Sender: TObject);
private
{ Private declarations }
function ShowRandom:string;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormShow(Sender: TObject);
var
i,j:Integer;
c:Char;
begin
lbl1.Caption:=''; //Õâ¸öÊDZêÇ©
for j:=0 to 3 do //Ëæ»úÉú³É4¸öaµ½zµÄ×Ö·û´®
begin
i:=Random(24);
c:=chr(ord('a') + i);
lbl1.Caption:=lbl1.Caption + c;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Randomize;
end;
procedure TForm1.btn1Click(Sender: TObject);
begin
if edit1.Text=lbl1.Caption then //³É¹¦
ShowMessage('0k')
else
ShowMessage('error');
end;
function ShowRandom:string;
var
i,j:Integer;
c:Char;
begin
Result:='';
for j:=0 to 3 do //Ëæ»úÉú³É4¸öaµ½zµÄ×Ö·û´®
begin
Randomize;
i:=Random(24);
c:=chr(ord('a') + i);
Result:=Result + c;
end;
end;
end.
Ïà¹ØÎĵµ£º
Ê×ÏÈÓÃNotepad»òResource workshop 4.5½¨Á¢RCÎļþ¡£ ½á¹¹ÈçÏ /****************************************************************************
rcdemo.rc
produced by Borland Resource Workshop
*****************************************************************************/
# ......
¸ù¾ÝDelphiÌṩµÄÓÐ¹Ø DLL±àдºÍµ÷ÓõİïÖúÐÅÏ¢£¬Äã¿ÉÒԺܿìÍê³ÉÒ»°ãµÄ DLL±àдºÍµ÷ÓÃµÄ Ó¦ÓóÌÐò¡£±¾ÎĽéÉܵÄÖ÷ÌâÊÇÈçºÎ±àдºÍµ÷ÓÃÄܹ»´«µÝ¸÷ÖÖ²ÎÊý£¨°üÀ¨¶ÔÏóʵÀý£©µÄ DLL¡£ÀýÈ磬 Ö÷½Ð³ÌÐò´«µÝ¸ø DLLÒ»¸öADOConnection ¶ÔÏóʾÀý×÷Ϊ²ÎÊý£¬ DLLÖеĺ¯ÊýºÍ¹ý³Ìµ÷ÓÃͨ¹ý¸Ã¶ÔÏó ʵÀý·ÃÎÊÊý¾Ý¿â¡£
ÐèÒªÃ÷ȷһЩ»ù±¾¸ÅÄî¡£¶ÔÓ ......
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
Button2: TButton;
procedure Butt ......
ÔÚDelphiÖУ¬Í¨³£¿ÉÒÔÓÃÒÔÏÂÈýÖÖ·½·¨À´ÊµÏÖ³ÌÐòµÄÑÓʱ£¬¼´TTtimer¿Ø¼þ£¬Sleepº¯Êý£¬GetTickCountº¯Êý¡£µ«ÊÇÆ侫¶ÈÊǸ÷²»ÏàͬµÄ¡£
Ò»¡¢ÈýÖÖ·½·¨µÄ¼òµ¥½éÉÜ
1£©TTtimer¿Ø¼þ
¡¡¡¡TTtimer¿Ø¼þµÄʵÖÊÊǵ÷ÓÃWindows API¶¨Ê±º¯ÊýSetTimerºÍKillTimerÀ´ÊµÏֵģ¬²¢¼ò»¯Á˶ÔWM_TIMER ÏûÏ¢µÄ´¦Àí¹ý³Ì¡£Í¨¹ýÉèÖÃOnTimerÊÂ
¼þºÍInte ......
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
Bu ......