Pop3ServerFrm.pas
上传用户:hylc_2004
上传日期:2014-01-23
资源大小:46800k
文件大小:3k
- unit Pop3ServerFrm;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs,
- StdCtrls, ExtCtrls, ComCtrls,Registry,WNDES;
- type
- TPop3ServerForm = class(TForm)
- BTOK: TButton;
- BTCancel: TButton;
- GroupBox1: TGroupBox;
- Label1: TLabel;
- Edit1: TEdit;
- Label2: TLabel;
- Label3: TLabel;
- Edit3: TEdit;
- Label4: TLabel;
- Edit4: TEdit;
- Edit2: TEdit;
- UpDown1: TUpDown;
- procedure BTCancelClick(Sender: TObject);
- procedure BTOKClick(Sender: TObject);
- procedure FormShow(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Pop3ServerForm: TPop3ServerForm;
- implementation
- uses
- RealMessengerUnit,RealMessengerImpl;
- {$R *.dfm}
- procedure TPop3ServerForm.BTCancelClick(Sender: TObject);
- begin
- Close;
- end;
- procedure TPop3ServerForm.BTOKClick(Sender: TObject);
- var
- TempReg:TRegistry;
- begin
- if Trim(Edit1.Text)='' then
- begin
- MessageBox(Handle,'请输入POP3 邮件服务器地址!','提示',MB_ICONINFORMATION);
- Exit;
- end;
- if Trim(Edit2.Text)='' then
- begin
- MessageBox(Handle,'请输入POP3 邮件服务器端口号!','提示',MB_ICONINFORMATION);
- Exit;
- end;
- try
- StrToInt(Trim(Edit2.Text));
- except
- MessageBox(Handle,'POP3 邮件服务器端口必须为数字!','提示',MB_ICONINFORMATION);
- Exit;
- end;
-
- if Trim(Edit3.Text)='' then
- begin
- MessageBox(Handle,'请输入POP3 邮件服务器帐号!','提示',MB_ICONINFORMATION);
- Exit;
- end;
- if Trim(Edit4.Text)='' then
- begin
- MessageBox(Handle,'请输入POP3 邮件服务器密码!','提示',MB_ICONINFORMATION);
- Exit;
- end;
- TempReg:=TRegistry.Create;
- try
- TempReg.RootKey:=HKEY_LOCAL_MACHINE;
- if TempReg.OpenKey(AppKey+''+Me.LoginName+'Init', True) then
- begin
- TempReg.WriteString('POP3Server',Trim(Edit1.Text));
- TempReg.WriteString('POP3Port',Trim(Edit2.Text));
- TempReg.WriteString('POP3User',Trim(Edit3.Text));
- TempReg.WriteString('POP3Pass',EncryStrHex(Trim(Edit4.Text),DESKEY));
- RealMessengerX.ClientPOP3.Host := Trim(Edit1.Text);
- RealMessengerX.ClientPOP3.Port := StrToInt(Trim(Edit2.Text));
- RealMessengerX.ClientPOP3.Username := Trim(Edit3.Text);
- RealMessengerX.ClientPOP3.Password := Trim(Edit4.Text);
- end;
- finally
- TempReg.Free;
- end;
- ModalResult:=mrOK;
- end;
- procedure TPop3ServerForm.FormShow(Sender: TObject);
- begin
- Edit1.text:=RealMessengerX.ClientPOP3.Host;
- Edit2.text:=IntToStr(RealMessengerX.ClientPOP3.Port);
- Edit3.text:=RealMessengerX.ClientPOP3.Username;
- Edit4.text:=RealMessengerX.ClientPOP3.Password;
- end;
- end.