home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1999 April / CD_Shareware_Magazine_31.iso / Free / Prg / ftpcl.exe / ALIASFOR.FRM (.txt) next >
Encoding:
Visual Basic Form  |  1997-07-18  |  10.1 KB  |  319 lines

  1. VERSION 4.00
  2. Begin VB.Form AliasForm 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H00C0C0C0&
  5.    BorderStyle     =   3  'Fixed Dialog
  6.    Caption         =   "HotList Manager"
  7.    ClientHeight    =   3435
  8.    ClientLeft      =   555
  9.    ClientTop       =   885
  10.    ClientWidth     =   4635
  11.    BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  12.       Name            =   "MS Sans Serif"
  13.       Size            =   8.25
  14.       Charset         =   0
  15.       Weight          =   700
  16.       Underline       =   0   'False
  17.       Italic          =   0   'False
  18.       Strikethrough   =   0   'False
  19.    EndProperty
  20.    ForeColor       =   &H80000008&
  21.    Height          =   3840
  22.    Icon            =   "ALIASFOR.frx":0000
  23.    Left            =   495
  24.    LinkTopic       =   "Form2"
  25.    ScaleHeight     =   3435
  26.    ScaleWidth      =   4635
  27.    Top             =   540
  28.    Width           =   4755
  29.    Begin VB.CommandButton DeleteButton 
  30.       Appearance      =   0  'Flat
  31.       BackColor       =   &H80000005&
  32.       Caption         =   "&Delete"
  33.       Height          =   495
  34.       Left            =   0
  35.       TabIndex        =   6
  36.       Top             =   2760
  37.       Width           =   1455
  38.    End
  39.    Begin VB.ComboBox SiteBox 
  40.       Appearance      =   0  'Flat
  41.       Height          =   315
  42.       Left            =   1680
  43.       Sorted          =   -1  'True
  44.       TabIndex        =   1
  45.       Top             =   360
  46.       Width           =   2895
  47.    End
  48.    Begin VB.TextBox StartingDirBox 
  49.       Appearance      =   0  'Flat
  50.       Height          =   285
  51.       Left            =   1680
  52.       TabIndex        =   5
  53.       Top             =   2280
  54.       Width           =   2895
  55.    End
  56.    Begin VB.TextBox PasswordBox 
  57.       Appearance      =   0  'Flat
  58.       Height          =   285
  59.       Left            =   1680
  60.       TabIndex        =   4
  61.       Top             =   1800
  62.       Width           =   2895
  63.    End
  64.    Begin VB.TextBox UserNameBox 
  65.       Appearance      =   0  'Flat
  66.       Height          =   285
  67.       Left            =   1680
  68.       TabIndex        =   3
  69.       Top             =   1320
  70.       Width           =   2895
  71.    End
  72.    Begin VB.TextBox HostAddressBox 
  73.       Appearance      =   0  'Flat
  74.       Height          =   285
  75.       Left            =   1680
  76.       TabIndex        =   2
  77.       Top             =   840
  78.       Width           =   2895
  79.    End
  80.    Begin VB.CommandButton CancelButton 
  81.       Appearance      =   0  'Flat
  82.       BackColor       =   &H80000005&
  83.       Caption         =   "&Cancel"
  84.       Height          =   495
  85.       Left            =   3120
  86.       TabIndex        =   8
  87.       Top             =   2760
  88.       Width           =   1455
  89.    End
  90.    Begin VB.CommandButton SaveButton 
  91.       Appearance      =   0  'Flat
  92.       BackColor       =   &H80000005&
  93.       Caption         =   "&Save"
  94.       Height          =   495
  95.       Left            =   1560
  96.       TabIndex        =   7
  97.       Top             =   2760
  98.       Width           =   1455
  99.    End
  100.    Begin VB.Label Label5 
  101.       Alignment       =   1  'Right Justify
  102.       Appearance      =   0  'Flat
  103.       BackColor       =   &H00FFFFFF&
  104.       BackStyle       =   0  'Transparent
  105.       Caption         =   "Starting Dir"
  106.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  107.          Name            =   "MS Sans Serif"
  108.          Size            =   9.75
  109.          Charset         =   0
  110.          Weight          =   700
  111.          Underline       =   0   'False
  112.          Italic          =   0   'False
  113.          Strikethrough   =   0   'False
  114.       EndProperty
  115.       ForeColor       =   &H00000000&
  116.       Height          =   375
  117.       Left            =   0
  118.       TabIndex        =   12
  119.       Top             =   2280
  120.       Width           =   1575
  121.    End
  122.    Begin VB.Label Label4 
  123.       Alignment       =   1  'Right Justify
  124.       Appearance      =   0  'Flat
  125.       BackColor       =   &H00FFFFFF&
  126.       BackStyle       =   0  'Transparent
  127.       Caption         =   "Password"
  128.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  129.          Name            =   "MS Sans Serif"
  130.          Size            =   9.75
  131.          Charset         =   0
  132.          Weight          =   700
  133.          Underline       =   0   'False
  134.          Italic          =   0   'False
  135.          Strikethrough   =   0   'False
  136.       EndProperty
  137.       ForeColor       =   &H00000000&
  138.       Height          =   375
  139.       Left            =   120
  140.       TabIndex        =   11
  141.       Top             =   1800
  142.       Width           =   1455
  143.    End
  144.    Begin VB.Label Label3 
  145.       Alignment       =   1  'Right Justify
  146.       Appearance      =   0  'Flat
  147.       BackColor       =   &H00FFFFFF&
  148.       BackStyle       =   0  'Transparent
  149.       Caption         =   "User Name"
  150.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  151.          Name            =   "MS Sans Serif"
  152.          Size            =   9.75
  153.          Charset         =   0
  154.          Weight          =   700
  155.          Underline       =   0   'False
  156.          Italic          =   0   'False
  157.          Strikethrough   =   0   'False
  158.       EndProperty
  159.       ForeColor       =   &H00000000&
  160.       Height          =   375
  161.       Left            =   120
  162.       TabIndex        =   10
  163.       Top             =   1320
  164.       Width           =   1455
  165.    End
  166.    Begin VB.Label Label2 
  167.       Alignment       =   1  'Right Justify
  168.       Appearance      =   0  'Flat
  169.       BackColor       =   &H00FFFFFF&
  170.       BackStyle       =   0  'Transparent
  171.       Caption         =   "Host Address"
  172.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  173.          Name            =   "MS Sans Serif"
  174.          Size            =   9.75
  175.          Charset         =   0
  176.          Weight          =   700
  177.          Underline       =   0   'False
  178.          Italic          =   0   'False
  179.          Strikethrough   =   0   'False
  180.       EndProperty
  181.       ForeColor       =   &H00000000&
  182.       Height          =   375
  183.       Left            =   120
  184.       TabIndex        =   9
  185.       Top             =   840
  186.       Width           =   1455
  187.    End
  188.    Begin VB.Label Label1 
  189.       Alignment       =   1  'Right Justify
  190.       Appearance      =   0  'Flat
  191.       BackColor       =   &H00FFFFFF&
  192.       BackStyle       =   0  'Transparent
  193.       Caption         =   "Site Name"
  194.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  195.          Name            =   "MS Sans Serif"
  196.          Size            =   9.75
  197.          Charset         =   0
  198.          Weight          =   700
  199.          Underline       =   0   'False
  200.          Italic          =   0   'False
  201.          Strikethrough   =   0   'False
  202.       EndProperty
  203.       ForeColor       =   &H00000000&
  204.       Height          =   375
  205.       Left            =   0
  206.       TabIndex        =   0
  207.       Top             =   360
  208.       Width           =   1575
  209.    End
  210. Attribute VB_Name = "AliasForm"
  211. Attribute VB_Creatable = False
  212. Attribute VB_Exposed = False
  213. Private Sub CancelButton_Click()
  214. Unload AliasForm
  215. End Sub
  216. Private Sub DeleteButton_Click()
  217.     If HotListRecords > 1 Then
  218.         For x = SiteBox.ListIndex + 1 To HotListRecords
  219.             For Y = 1 To 5
  220.                 AliasDB(x, Y) = AliasDB(x + 1, Y)
  221.             Next Y
  222.         Next x
  223.         HotListRecords = HotListRecords - 1
  224.         x = SaveAliasDB()
  225.     Else
  226.         Kill "ftpalias.dat"
  227.     End If
  228. End Sub
  229. Private Sub Form_Load()
  230.     If HotListRecords > 0 Then
  231.         For x = 1 To HotListRecords
  232.             SiteBox.AddItem AliasDB(x, 1)
  233.         Next x
  234.     End If
  235. End Sub
  236. Private Function SaveAliasDB()
  237.     FileName = "ftpalias.dat"
  238.     Open FileName For Output As #1
  239.         
  240.         Write #1, HotListRecords
  241.         
  242.         For x = 1 To HotListRecords
  243.             For Y = 1 To 5
  244.                 Write #1, AliasDB(x, Y)
  245.             Next Y
  246.         Next x
  247.             
  248.     Close #1
  249. End Function
  250. Private Sub SaveButton_Click()
  251.     HotListRecords = HotListRecords + 1
  252.     AliasDB(HotListRecords, 1) = SiteBox
  253.     AliasDB(HotListRecords, 2) = HostAddressBox
  254.     AliasDB(HotListRecords, 3) = UserNameBox
  255.     AliasDB(HotListRecords, 4) = PasswordBox
  256.     AliasDB(HotListRecords, 5) = StartingDirBox
  257.     x = SaveAliasDB()
  258.     Load MainForm.FTPSite(HotListRecords)
  259.     MainForm.FTPSite(HotListRecords).Caption = SiteBox
  260.     Unload AliasForm
  261. End Sub
  262. Private Sub SiteBox_Click()
  263.             
  264.     x = SiteBox.ListIndex + 1
  265.     If x = 0 Then Exit Sub
  266.     HostAddressBox = AliasDB(x, 2)
  267.     UserNameBox = AliasDB(x, 3)
  268.     PasswordBox = AliasDB(x, 4)
  269.     StartingDirBox = AliasDB(x, 5)
  270. End Sub
  271. Private Sub SiteBox_KeyPress(KeyAscii As Integer)
  272.     Select Case KeyAscii
  273.         Case 0
  274.             'Null - triggered by DropDown Event
  275.         Case 8
  276.             If Len(UserInput) > 0 Then
  277.                 UserInput = Left$(UserInput, Len(UserInput) - 1)
  278.             Else
  279.                 HostAddressBox = ""
  280.                 UserNameBox = ""
  281.                 PasswordBox = ""
  282.                 StartingDirBox = ""
  283.                 SiteBox.Text = ""
  284.                 Exit Sub
  285.             End If
  286.         Case Is > 31
  287.             UserInput = UserInput + Chr$(KeyAscii)
  288.         Case Else
  289.             Exit Sub
  290.     End Select
  291.     For x = 1 To HotListRecords
  292.         
  293.         If StrComp(Left$(AliasDB(x, 1), Len(UserInput)), UserInput, 1) = 0 Then
  294.             MaintenanceHostName = AliasDB(x, 1)
  295.             SiteBox.SelStart = 0
  296.             SiteBox.SelLength = Len(UserInput)
  297.             
  298.             HostAddressBox = AliasDB(x, 2)
  299.             UserNameBox = AliasDB(x, 3)
  300.             PasswordBox = AliasDB(x, 4)
  301.             StartingDirBox = AliasDB(x, 5)
  302.             Exit Sub
  303.         Else
  304.             MaintenanceHostName = UserInput
  305.         
  306.         End If
  307.     Next x
  308.             HostAddressBox = ""
  309.             UserNameBox = ""
  310.             PasswordBox = ""
  311.             StartingDirBox = ""
  312. End Sub
  313. Private Sub SiteBox_KeyUp(KeyCode As Integer, Shift As Integer)
  314.     If UserInput = "" Then Exit Sub
  315.     SiteBox.Text = MaintenanceHostName
  316.     SiteBox.SelStart = 0
  317.     SiteBox.SelLength = Len(UserInput)
  318. End Sub
  319.