home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 April / ChipCD_498.iso / software / ftp / quickftp / quickft2.frm < prev    next >
Text File  |  1996-01-30  |  6KB  |  251 lines

  1. VERSION 2.00
  2. Begin Form Get_file 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Get File"
  6.    ClientHeight    =   2085
  7.    ClientLeft      =   1650
  8.    ClientTop       =   2775
  9.    ClientWidth     =   5595
  10.    ControlBox      =   0   'False
  11.    Height          =   2490
  12.    Left            =   1590
  13.    LinkTopic       =   "Form2"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   2085
  17.    ScaleWidth      =   5595
  18.    Top             =   2430
  19.    Width           =   5715
  20.    Begin PictureBox Picture1 
  21.       AutoSize        =   -1  'True
  22.       BorderStyle     =   0  'None
  23.       Height          =   480
  24.       Index           =   1
  25.       Left            =   360
  26.       Picture         =   QUICKFT2.FRX:0000
  27.       ScaleHeight     =   480
  28.       ScaleWidth      =   480
  29.       TabIndex        =   10
  30.       Top             =   360
  31.       Width           =   480
  32.    End
  33.    Begin PictureBox Picture1 
  34.       AutoSize        =   -1  'True
  35.       BorderStyle     =   0  'None
  36.       Height          =   480
  37.       Index           =   0
  38.       Left            =   360
  39.       Picture         =   QUICKFT2.FRX:0302
  40.       ScaleHeight     =   480
  41.       ScaleWidth      =   480
  42.       TabIndex        =   9
  43.       Top             =   360
  44.       Width           =   480
  45.    End
  46.    Begin CheckBox ChkAscii 
  47.       Caption         =   "ASCII transfer"
  48.       Height          =   255
  49.       Left            =   3120
  50.       TabIndex        =   8
  51.       Top             =   1200
  52.       Width           =   2295
  53.    End
  54.    Begin TextBox txtCycle 
  55.       Height          =   285
  56.       Left            =   2160
  57.       TabIndex        =   6
  58.       Text            =   "40"
  59.       Top             =   1200
  60.       Width           =   735
  61.    End
  62.    Begin CommandButton Cancelget 
  63.       Cancel          =   -1  'True
  64.       Caption         =   "Cancel"
  65.       Height          =   375
  66.       Left            =   4440
  67.       TabIndex        =   4
  68.       Top             =   1560
  69.       Width           =   975
  70.    End
  71.    Begin CommandButton GetFile 
  72.       Caption         =   "Get"
  73.       Height          =   375
  74.       Left            =   3240
  75.       TabIndex        =   3
  76.       Top             =   1560
  77.       Width           =   975
  78.    End
  79.    Begin TextBox LocalFile 
  80.       Height          =   285
  81.       Left            =   2160
  82.       TabIndex        =   2
  83.       Text            =   "LocalFile"
  84.       Top             =   720
  85.       Width           =   3255
  86.    End
  87.    Begin TextBox HostFile 
  88.       Height          =   285
  89.       Left            =   2160
  90.       TabIndex        =   1
  91.       Text            =   "HostFile"
  92.       Top             =   240
  93.       Width           =   3255
  94.    End
  95.    Begin Label Label3 
  96.       Alignment       =   1  'Right Justify
  97.       BackColor       =   &H00C0C0C0&
  98.       Caption         =   "Cycle Time (sec):"
  99.       Height          =   255
  100.       Left            =   360
  101.       TabIndex        =   7
  102.       Top             =   1200
  103.       Width           =   1695
  104.    End
  105.    Begin Label Label2 
  106.       Alignment       =   1  'Right Justify
  107.       BackColor       =   &H00C0C0C0&
  108.       Caption         =   "Local File :"
  109.       Height          =   255
  110.       Left            =   960
  111.       TabIndex        =   5
  112.       Top             =   720
  113.       Width           =   1095
  114.    End
  115.    Begin Label Label1 
  116.       Alignment       =   1  'Right Justify
  117.       BackColor       =   &H00C0C0C0&
  118.       Caption         =   "Host File :"
  119.       Height          =   255
  120.       Left            =   960
  121.       TabIndex        =   0
  122.       Top             =   240
  123.       Width           =   1095
  124.    End
  125. End
  126.  
  127. Sub Cancelget_Click ()
  128.   '
  129.   OKDialog = False
  130.   Unload Get_file
  131.   '
  132. End Sub
  133.  
  134.  
  135. Sub Form_Activate ()
  136. '__
  137. '__ Get_file Form_Activate
  138. '__   calls     GLOBAL switch_to
  139. '__
  140.  
  141.  LocalFile = Local_File_Name
  142.  If FTP_form.Dir_list.ListIndex >= 0 Then
  143.   HostFile = FTP_form.Dir_list.List(FTP_form.Dir_list.ListIndex)
  144.   switch_to LocalFile
  145.  Else
  146.   HostFile = Host_File_Name
  147.   switch_to HostFile
  148.  End If
  149.  If putmode Then
  150.    Rem  'put clicked
  151.    If HostFile = src_name And LocalFile = dest_name Then switch_to txtCycle
  152.  Else
  153.    Rem  'get clicked
  154.    If HostFile = dest_name And LocalFile = src_name Then switch_to txtCycle
  155.  End If
  156. End Sub
  157.  
  158.  
  159. Sub Form_Load ()
  160.   
  161. picture1(0).Visible = Not putmode
  162. picture1(1).Visible = putmode
  163.  
  164. If putmode Then
  165.   Caption = "Put File to " & HostName
  166.   Getfile.Caption = "Put"
  167. Else
  168.   Caption = "Get File from " & HostName
  169.   Getfile.Caption = "Get"
  170. End If
  171. txtCycle = FTP_form.Cycle_sec
  172. HostFile.Text = 1
  173. chkAscii = -(transtype = Asc("A"))
  174. FTP_form.Timer2.Enabled = False
  175. FTP_form.TimeLeft.Visible = False
  176. End Sub
  177.  
  178.  
  179. Sub GetFile_Click ()
  180.   If Len(Trim$(src_name)) <> 0 And Len(Trim$(dest_name)) <> 0 Then
  181.    OKDialog = True
  182.    If putmode Then
  183.     src_name = Get_file!LocalFile.Text
  184.     dest_name = Get_file!HostFile.Text
  185.     Local_File_Name = src_name
  186.     Host_File_Name = dest_name
  187.    Else
  188.     src_name = Get_file!HostFile.Text
  189.     dest_name = Get_file!LocalFile.Text
  190.     Host_File_Name = src_name
  191.     Local_File_Name = dest_name
  192.    End If
  193.    FTP_form!Cycle_sec = Val(Get_file!txtCycle)
  194.    transtype = Asc("I")
  195.    If chkAscii Then transtype = Asc("A")
  196.    If Val(txtCycle) > 0 Then
  197.      doitmode = False
  198.      cyclemode = True
  199.    End If
  200.    Unload Get_file
  201.   Else
  202.     MsgBox "You must enter Host and Local filenames", 64, "Warning"
  203.   End If
  204. End Sub
  205.  
  206.  
  207. Sub HostFile_KeyPress (keyascii As Integer)
  208. '__
  209. '__ Get_file HostFile_KeyPress
  210. '__
  211. '__   parameter keyascii As Integer
  212. '__   calls     GLOBAL switch_to
  213. '__
  214.  If keyascii = 13 Then keyascii = 0: switch_to LocalFile
  215.  
  216. End Sub
  217.  
  218.  
  219. Sub LocalFile_KeyPress (keyascii As Integer)
  220. '__
  221. '__ Get_file LocalFile_KeyPress
  222. '__
  223. '__   parameter keyascii As Integer
  224. '__   calls     GLOBAL switch_to
  225. '__
  226.  If keyascii = 13 Then keyascii = 0: switch_to txtCycle
  227.  
  228. End Sub
  229.  
  230.  
  231. Sub txtCycle_GotFocus ()
  232. '__
  233. '__ Get_file txtCycle_GotFocus
  234. '__   calls     GLOBAL switch_to
  235. '__
  236.  switch_to txtCycle
  237. End Sub
  238.  
  239.  
  240. Sub txtCycle_KeyPress (keyascii As Integer)
  241. '__
  242. '__ Get_file txtCycle_KeyPress
  243. '__
  244. '__   parameter keyascii As Integer
  245. '__
  246.  If keyascii = 13 Then keyascii = 0: Getfile.SetFocus
  247.  
  248. End Sub
  249.  
  250.  
  251.