Changeset 2 for trunk


Ignore:
Timestamp:
Jul 31, 2009, 3:04:35 PM (15 years ago)
Author:
george
Message:
  • Added: Test telnet connection with custom class TRouterOS.
Location:
trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        22OpenWinBox.dsk
        33*.dcu
         4*.~dsk
  • trunk/OpenWinBox.dpr

    r1 r2  
    77  UApplicationInfo in 'UApplicationInfo.pas',
    88  URegistry in 'URegistry.pas',
    9   UHostAddressList in 'UHostAddressList.pas';
     9  UHostAddressList in 'UHostAddressList.pas',
     10  URouterOS in 'URouterOS.pas',
     11  UMainForm in 'UMainForm.pas' {MainForm};
    1012
    1113{$R *.res}
     
    1517  ReportMemoryLeaksOnShutdown := DebugHook <> 0;
    1618  {$WARN SYMBOL_PLATFORM ON}
     19 
    1720  Application.Initialize;
     21  Application.ShowMainForm := False;
    1822  Application.Title := 'OpenWinBox';
    1923  Application.CreateForm(TLoaderForm, LoaderForm);
     24  Application.CreateForm(TMainForm, MainForm);
    2025  Application.Run;
    2126end.
  • trunk/ULoaderForm.dfm

    r1 r2  
    5858    TabOrder = 0
    5959    Text = 'Edit1'
    60     ExplicitWidth = 159
    6160  end
    6261  object Edit2: TEdit
     
    6867    TabOrder = 1
    6968    Text = 'Edit2'
    70     ExplicitWidth = 159
    7169  end
    7270  object ButtonConnect: TButton
     
    7977    Default = True
    8078    TabOrder = 2
    81     ExplicitLeft = 254
     79    OnClick = ButtonConnectClick
    8280  end
    8381  object CheckBox1: TCheckBox
     
    113111    TabOrder = 6
    114112    Text = 'Edit4'
    115     ExplicitWidth = 159
    116113  end
    117114  object Edit3: TEdit
     
    124121    TabOrder = 7
    125122    Text = 'Edit3'
    126     ExplicitWidth = 159
    127123  end
    128124  object ListView1: TListView
     
    152148    OnData = ListView1Data
    153149    OnSelectItem = ListView1SelectItem
    154     ExplicitWidth = 329
    155     ExplicitHeight = 86
    156150  end
    157151  object ButtonSave: TButton
     
    164158    TabOrder = 9
    165159    OnClick = ButtonSaveClick
    166     ExplicitLeft = 253
    167160  end
    168161  object ButtonRemove: TButton
     
    176169    TabOrder = 10
    177170    OnClick = ButtonRemoveClick
    178     ExplicitLeft = 254
    179171  end
    180172  object ButtonTools: TButton
     
    187179    TabOrder = 11
    188180    OnClick = ButtonToolsClick
    189     ExplicitLeft = 253
    190181  end
    191182  object PopupMenu1: TPopupMenu
  • trunk/ULoaderForm.pas

    r1 r2  
    55uses
    66  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    7   Dialogs, ComCtrls, StdCtrls, Menus, UHostAddressList;
     7  Dialogs, ComCtrls, StdCtrls, Menus, UHostAddressList, IdTelnet,
     8  tlntsend, ssl_openssl, ssl_openssl_lib, ssl_cryptlib;
    89
    910type
     
    4445    procedure ImportAddresses1Click(Sender: TObject);
    4546    procedure RemoveAllAddresses1Click(Sender: TObject);
     47    procedure ButtonConnectClick(Sender: TObject);
    4648  private
    4749    HostAddressList: THostAddressList;
     
    6264
    6365uses
    64   UApplicationInfo, URegistry, Registry;
     66  UApplicationInfo, URegistry, Registry, IdTCPClient, IdTCPConnection,
     67  UMainForm;
    6568
    6669{$R *.dfm}
     
    112115  PopupPoint := ClientToScreen(PopupPoint);
    113116  PopupMenu1.Popup(PopupPoint.X, PopupPoint.Y);
     117end;
     118
     119procedure TLoaderForm.ButtonConnectClick(Sender: TObject);
     120begin
     121  MainForm.Show;
     122  MainForm.RouterOS.Connect(Edit1.Text, Edit2.Text, Edit3.Text);
     123  Hide;
    114124end;
    115125
     
    201211
    202212procedure TLoaderForm.LoadFromRegistry;
    203 var
    204   I: Integer;
    205   NewHostAddress: THostAddress;
    206213begin
    207214  with TRegistryEx.Create do try
     
    209216    OpenKey(RegistryKey, True);
    210217    CheckBox3.Checked := ReadBoolWithDefault('LoadPreviousSession', True);
     218    CheckBox2.Checked := ReadBoolWithDefault('SecureMode', True);
    211219    CheckBox1.Checked := ReadBoolWithDefault('KeepPassword', False);
    212     CheckBox2.Checked := ReadBoolWithDefault('SecureMode', True);
    213220    if CheckBox3.Checked then begin
    214221      Edit1.Text := ReadStringWithDefault('Address', '');
     
    270277    if CheckBox1.Checked then WriteString('Password', Edit3.Text)
    271278      else WriteString('Password', '');
    272     WriteBool('SecureMethod', CheckBox2.Checked);
     279    WriteBool('SecureMode', CheckBox2.Checked);
    273280    WriteBool('LoadPreviouisSession', CheckBox3.Checked);
    274281  finally
Note: See TracChangeset for help on using the changeset viewer.