4 BackColor = &H00C0C0C0&
5 BorderStyle = 3 'Fixed Dialog
6 Caption = "Download..."
13 name = "MS Sans Serif"
19 strikethrough = 0 'False
21 ForeColor = &H80000008&
32 Begin Threed.SSPanel info
43 BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
44 name = "MS Sans Serif"
50 strikethrough = 0 'False
56 Begin GaugeLib.Gauge progress
69 Begin VB.CommandButton start_button
71 BackColor = &H80000005&
72 Caption = "&Start download"
74 name = "MS Sans Serif"
80 strikethrough = 0 'False
88 Begin Threed.SSPanel DestFile
99 BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
100 name = "MS Sans Serif"
106 strikethrough = 0 'False
112 Begin Threed.SSPanel SourceFile
122 Caption = "SourceFile"
123 BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
124 name = "MS Sans Serif"
130 strikethrough = 0 'False
136 Begin VB.CommandButton cancel_button
138 BackColor = &H80000005&
141 name = "MS Sans Serif"
147 strikethrough = 0 'False
155 Begin Threed.SSPanel Panel3D1
169 Begin MSComDlg.CommonDialog SaveAs
176 DialogTitle = "Save As..."
179 Begin VB.Label Label3
182 BackColor = &H80000005&
183 BackStyle = 0 'Transparent
186 name = "MS Sans Serif"
192 strikethrough = 0 'False
194 ForeColor = &H80000008&
201 Begin VB.Label Label2
204 BackColor = &H80000005&
205 BackStyle = 0 'Transparent
208 name = "MS Sans Serif"
214 strikethrough = 0 'False
216 ForeColor = &H80000008&
223 Begin VB.Label Label1
225 BackColor = &H80000005&
226 BackStyle = 0 'Transparent
229 name = "MS Sans Serif"
235 strikethrough = 0 'False
237 ForeColor = &H80000008&
245 Attribute VB_Name = "Download"
246 Attribute VB_Creatable = False
247 Attribute VB_Exposed = False
251 Private Sub cancel_button_Click()
253 If InProgress% = 1 Then
262 Private Sub Form_Load()
266 Download.WindowState = 0
267 Download.Top = Int((MainWin.Height - Download.Height) / 3)
268 Download.Left = Int((MainWin.Width - Download.Width) / 2)
270 SourceFile.Caption = DownLoadFileName$
272 SaveAs.filename = DownLoadFileName$
275 DestFile.Caption = SaveAs.filename
281 Private Sub start_button_Click()
283 If begin_trans() = True Then
284 Info.Caption = "Sending server command"
286 serv_puts ("OPEN " + DownLoadFileName$)
290 If Left$(a$, 1) <> "2" Then
293 FileLength& = Val(extract$(Right$(a$, Len(a$) - 4), 0))
296 Info.Caption = "File len is " + Str$(FileLength&)
300 If FileLength& < 0 Then
301 MsgBox Right$(a$, Len(a$) - 4), 16, "Error"
307 Open DestFile.Caption For Output As #1
308 start_button.Enabled = False
309 start_button.Visible = False
312 Progress.Max = FileLength& / 1024
315 Do While GotBytes& < FileLength&
316 If Cancelled% = 1 Then GoTo ENDOFXFER
318 If (FileLength& - GotBytes&) < 4096 Then NeedBytes& = FileLength& - GotBytes&
319 If begin_trans() = True Then
320 serv_puts ("READ " + Str$(GotBytes&) + "|" + Str$(NeedBytes&))
322 If Left$(a$, 1) = "6" Then
323 b$ = serv_read(CInt(NeedBytes&))
324 GotBytes& = GotBytes& + NeedBytes&
329 Progress.Value = GotBytes& / 1024
330 Info.Caption = "Received " + Str$(GotBytes&) + " of " + Str$(FileLength&) + " bytes"
336 If begin_trans() = True Then
339 cancel_button.Caption = "&OK!"