?? frmsysclean.pas
字號:
unit FrmSysClean;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, Buttons, ComCtrls;
type
TFrmSysClean1 = class(TForm)
Panel2: TPanel;
Panel3: TPanel;
Panel1: TPanel;
Panel4: TPanel;
CheckBox1: TCheckBox;
CheckBox3: TCheckBox;
CheckBox4: TCheckBox;
CheckBox2: TCheckBox;
SpeedButton1: TSpeedButton;
procedure SpeedButton1Click(Sender: TObject);
private
{ Private declarations }
function CheckTrue:boolean;
procedure CleanDeletedMail;
procedure CleanLog;
procedure CleanRelyedMail;
procedure CleanFailedMail;
public
{ Public declarations }
end;
var
FrmSysClean1: TFrmSysClean1;
implementation
uses UnitConst, UnitDataModule;
{$R *.dfm}
function TFrmSysClean1.CheckTrue:boolean;
begin
result:=false;
if (CheckBox1.Checked=false) and (CheckBox2.Checked=false)
and (CheckBox3.Checked=false) and (CheckBox4.Checked=false) then
begin
application.MessageBox('請至少選擇一項操作','提示信息',MB_ok or MB_ICONINFORMATION);
exit;
end;
result:=true;
end;
//刪除--------------------------------------------------------------------------
procedure TFrmSysClean1.SpeedButton1Click(Sender: TObject);
begin
if CheckTrue=true then
begin
case MessageBox(handle,pchar('確認所選的項目嗎'),'提示信息',MB_YESNO or
MB_ICONQUESTION) of
IDNO:exit;
end;
if CheckBox1.Checked=true then
begin
screen.Cursor:=crHourGlass;
CleanDeletedMail;
screen.Cursor:=crDefault;
application.MessageBox('標記刪除的郵件清理成功','提示信息',MB_ok or MB_ICONINFORMATION);
end;
if CheckBox3.Checked=true then
begin
screen.Cursor:=crHourGlass;
CleanRelyedMail;
screen.Cursor:=crDefault;
application.MessageBox('轉發成功的郵件清理成功','提示信息',MB_ok or MB_ICONINFORMATION);
end;
if CheckBox4.Checked=true then
begin
screen.Cursor:=crHourGlass;
CleanFailedMail;
screen.Cursor:=crDefault;
application.MessageBox('轉發失敗的郵件清理成功','提示信息',MB_ok or MB_ICONINFORMATION);
end;
if CheckBox2.Checked=true then
begin
screen.Cursor:=crHourGlass;
CleanLog;
screen.Cursor:=crDefault;
application.MessageBox('log清理成功','提示信息',MB_ok or MB_ICONINFORMATION);
end;
end;
end;
//------------------------------------------------------------------------------
procedure TFrmSysClean1.CleanDeletedMail;
begin
UnitDataModule1.DCOMConnection1.AppServer.CleanDeletedMail;
UnitDataModule1.CleanDeletedMailRecord;
end;
procedure TFrmSysClean1.CleanRelyedMail;
begin
UnitDataModule1.DCOMConnection1.AppServer.CleanRelyedMail;
UnitDataModule1.CleanRelyedMailRecord;
end;
procedure TFrmSysClean1.CleanFailedMail;
begin
UnitDataModule1.DCOMConnection1.AppServer.CleanFailedMail;
UnitDataModule1.CleanFailedMailRecord;
end;
procedure TFrmSysClean1.CleanLog;
begin
UnitDataModule1.DCOMConnection1.AppServer.CleanLog;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -