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

📄 rasdial3.pas

📁 ras
💻 PAS
📖 第 1 页 / 共 2 页
字号:


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TConfigureAutoForm.SetMailDir(newValue : String);
begin
    MailDirEdit.Text := newValue;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
function TConfigureAutoForm.GetMonthlyDuration : Boolean;
begin
    Result := MonthlyDurationCheckBox.Checked;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TConfigureAutoForm.SetMonthlyDuration(newValue : Boolean);
begin
    MonthlyDurationCheckBox.Checked := newValue;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
function TConfigureAutoForm.GetAutoExecuteBrowser : Boolean;
begin
    Result := AutoExecuteBrowserCheckBox.Checked;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
function TConfigureAutoForm.GetAutoExecuteMail : Boolean;
begin
    Result := AutoExecuteMailCheckBox.Checked;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
function TConfigureAutoForm.GetAutoExecuteNews : Boolean;
begin
    Result := AutoExecuteNewsCheckBox.Checked;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TConfigureAutoForm.SetAutoExecuteBrowser(newValue : Boolean);
begin
    AutoExecuteBrowserCheckBox.Checked := newValue;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TConfigureAutoForm.SetAutoExecuteMail(newValue : Boolean);
begin
    AutoExecuteMailCheckBox.Checked := newValue;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TConfigureAutoForm.SetAutoExecuteNews(newValue : Boolean);
begin
    AutoExecuteNewsCheckBox.Checked := newValue;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
function TConfigureAutoForm.GetAutoUserName : Boolean;
begin
    Result := AutoUserNameCheckBox.Checked;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TConfigureAutoForm.SetAutoUserName(newValue : Boolean);
begin
    AutoUserNameCheckBox.Checked := newValue;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
function TConfigureAutoForm.GetAutoConnect : Boolean;
begin
    Result := AutoConnectCheckBox.Checked;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TConfigureAutoForm.SetAutoConnect(newValue : Boolean);
begin
    AutoConnectCheckBox.Checked := newValue;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
function TConfigureAutoForm.GetAutoPassword : Boolean;
begin
    Result := AutoPasswordCheckBox.Checked;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TConfigureAutoForm.SetAutopassword(newValue : Boolean);
begin
    AutoPasswordCheckBox.Checked := newValue;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TConfigureAutoForm.CancelButtonClick(Sender: TObject);
begin
    inherited;
    ModalResult := mrCancel;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TConfigureAutoForm.OkButtonClick(Sender: TObject);
begin
    inherited;
    ModalResult := mrOk;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TConfigureAutoForm.AutoExecuteBrowserCheckBoxClick(
  Sender: TObject);
begin
    SetAutoExecuteBrowser(AutoExecuteBrowserCheckBox.Checked);
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TConfigureAutoForm.ExecuteBrowser;
begin
    ExecuteProg(BrowserExeEdit.Text, BrowserDirEdit.Text);
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TConfigureAutoForm.ExecuteMail;
begin
    ExecuteProg(MailExeEdit.Text, MailDirEdit.Text);
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TConfigureAutoForm.ExecuteNews;
begin
    ExecuteProg(NewsExeEdit.Text, NewsDirEdit.Text);
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TConfigureAutoForm.ExecuteBrowserAuto;
begin
    if AutoExecuteBrowserCheckBox.Checked then
        ExecuteBrowser;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TConfigureAutoForm.ExecuteMailAuto;
begin
    if AutoExecuteNewsCheckBox.Checked then
    ExecuteMail;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TConfigureAutoForm.ExecuteNewsAuto;
begin
    if AutoExecuteNewsCheckBox.Checked then
        ExecuteNews;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TConfigureAutoForm.ExecuteProg(Exe, Dir : String);
var
    ExeName : String;
    Params  : String;
    I       : Integer;
    Status  : Integer;
    Msg     : String;
begin
    if Exe[1] = '"' then begin
        I := 2;
        while (I <= Length(Exe)) and (Exe[I] <> '"') do
            Inc(I);
        Params  := Trim(Copy(Exe, I + 1, Length(Exe)));
        ExeName := Trim(Copy(Exe, 2, I - 2));
    end
    else begin
        I := 1;
        while (I <= Length(Exe)) and
              not (Exe[I] in ['/', '*', '?', '"', '<', '>', '|']) do
            Inc(I);
        Params  := Trim(Copy(Exe, I, Length(Exe)));
        ExeName := Trim(Copy(Exe, 1, I - 1));
    end;

    Status := ShellExecute(Handle, 'open', PChar(ExeName),
                           PChar(Params), PChar(Dir), SW_SHOWNORMAL);
    if Status > 32 then
        Exit;

    case Status of
    0                      : Msg := 'The operating system is out of memory ' +
                                    'or resources.';
    ERROR_FILE_NOT_FOUND   : Msg := 'The specified file was not found.';
    ERROR_PATH_NOT_FOUND   : Msg := 'The specified path was not found.';
    ERROR_BAD_FORMAT	   : Msg := 'The .EXE file is invalid (non-Win32 ' +
                                    '.EXE or error in .EXE image).';
    SE_ERR_ACCESSDENIED	   : Msg := 'The operating system denied access to ' +
                                    'the specified file.';
    SE_ERR_ASSOCINCOMPLETE : Msg := 'The filename association is incomplete ' +
                                    'or invalid.';
    SE_ERR_DDEBUSY	   : Msg := 'The DDE transaction could not be ' +
                                    'completed because other DDE ' +
                                    'transactions were being processed.';
    SE_ERR_DDEFAIL	   : Msg := 'The DDE transaction failed.';
    SE_ERR_DDETIMEOUT	   : Msg := 'The DDE transaction could not be ' +
                                    'completed because the request timed out.';
    SE_ERR_DLLNOTFOUND	   : Msg := 'The specified dynamic-link library was ' +
                                    'not found.';
    SE_ERR_NOASSOC	   : Msg := 'There is no application associated with ' +
                                    'the given filename extension.';
    SE_ERR_OOM	           : Msg := 'There was not enough memory to complete ' +
                                    'the operation.';
    SE_ERR_SHARE	   : Msg := 'A sharing violation occurred.';
    else
                             Msg := 'ShellExecute failed with error #' +
                                    IntToStr(Status);
    end;
    MessageBeep(MB_OK);
    Msg := Msg + #10 + 'trying to execute ''' + Exe + '''';
    Application.MessageBox(PChar(Msg), 'Warning', MB_OK);
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}

end.

{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -