I do can upload the download control, welcome to use.

Source: Internet
Author: User
Tags goto connect
Control | upload | download | Download Control This is the source program for the control:
Project Name: my
Control Name: testftp

Dim FileName as String
Dim Connect as Boolean


Private Sub Cmdcd_click ()

Call Link
' Inet1.execute, CD c2000 '
Connect = True

End Sub

Private Sub Cmdlist_click ()

If connect = True Then
Inet1.execute, "LS"
Else
Label1.Caption = "Please click Connect first!"
End If

End Sub


Private Sub Combo1_click ()

FileName = Combo1.text ' file name of download file

End Sub

Private Sub Cmddown_click ()

Dim Filelast as String ' last name of file '
Dim savefilename as String ' file name in Ftpserver
Call Link

If FileName = "" Then
Label1.Caption = "Please select File to download!"
Else
Filelast = ""
For i = 1 to Len (FileName)
If Mid (FileName, I, 1) <> "." Then
Filelast = Filelast + Mid (FileName, I, 1)
Else
Filelast = ""
End If
Next
REDO:CommonDialog1.ShowSave

If InStr (1, Commondialog1.filename, "", 1) > 0 Then
Label1.Caption = "The file can ' t include space!"
MyVar = MsgBox ("Redo it?", "Download file")
If MyVar = "1" Then
GoTo REDO:
Else
GoTo Nodo:
End If
End If

Savefilename = Commondialog1.filename & "." & Filelast
Inet1.execute, "Get" & FileName & "" & Savefilename
End If
Nodo:

End Sub

Private Sub Cmdupload_click ()

Dim Savefilename as String
Dim upfilename as String ' file name of upload file include path
Dim MyVar
Savefilename = ""
Call Link

REDO:CommonDialog1.ShowOpen

If InStr (1, Commondialog1.filename, "", 1) > 0 Then
MsgBox "The file can ' t include space!"
MyVar = MsgBox ("Redo it?", "Upload file")
If MyVar = "1" Then
GoTo REDO:
Else
GoTo Nodo:
End If
End If

Upfilename = Commondialog1.filename
' MsgBox upfilename

For i = 1 to Len (upfilename)
If Mid (Upfilename, I, 1) <> "\" Then
Savefilename = Savefilename + Mid (upfilename, I, 1)
Else
Savefilename = ""
End If
Next

If savefilename = "" Then
Label1.Caption = "No file!"
Else
Inet1.execute, "put" & Upfilename & "" & Savefilename
End If
Nodo:

End Sub




Private Sub inet1_statechanged (ByVal State as Integer)

Select Case State
Case 1
Label1.Caption = "Querying the IP address of the specified host"
Case 2
Label1.Caption = "The IP address of the specified host was successfully found. "



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.