J
joove
Unregistered / Unconfirmed
GUEST, unregistred user!
我有一个用于检查是否有心邮件到达的程序,编译都通过了,就是没有我想要的结果
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, Psock, NMpop3, StdCtrls;
type
TForm1 = class(TForm)
NMPOP31: TNMPOP3;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
procedure NMPOP31ConnectionFailed(Sender: TObject);
procedure NMPOP31Failure(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
i:integer;
implementation
{$R *.DFM}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if (NMPOP31.MailCount>i) then
showmessage('Sir,you have new mail arrival');
i:=NMPOP31.MailCount;
end;
procedure TForm1.NMPOP31ConnectionFailed(Sender: TObject);
begin
showmessage(' not succeed');
end;
procedure TForm1.NMPOP31Failure(Sender: TObject);
begin
showmessage('ft,联不上');
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
NMPOP31.Connect;
i:=NMPOP31.MailCount;
end;
end.
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, Psock, NMpop3, StdCtrls;
type
TForm1 = class(TForm)
NMPOP31: TNMPOP3;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
procedure NMPOP31ConnectionFailed(Sender: TObject);
procedure NMPOP31Failure(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
i:integer;
implementation
{$R *.DFM}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if (NMPOP31.MailCount>i) then
showmessage('Sir,you have new mail arrival');
i:=NMPOP31.MailCount;
end;
procedure TForm1.NMPOP31ConnectionFailed(Sender: TObject);
begin
showmessage(' not succeed');
end;
procedure TForm1.NMPOP31Failure(Sender: TObject);
begin
showmessage('ft,联不上');
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
NMPOP31.Connect;
i:=NMPOP31.MailCount;
end;
end.