⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmsysclean.pas

📁 Mailserver Source code - Delphi. Simple Mail server source code. SMTP and POP3 protocols.
💻 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 + -