[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.4

Explain This FTP Program?!?!?!?!

Asked by sjaguar13 in Visual Basic Programming

I need help with this ftp program. I want to do stuff with it but don't know how some stuff works. I don't just want to copy and paste because that teaches me nothing. I really need to get the basics with it. I know how to get it to connect to the host but I get lost when it comes to the password and the username. If you need more code (this is just the main form) or if you want the whole source code, just ask.

Option Explicit
Private PrevButton
Dim Buffer As Integer
Dim States(8) As Com ' initialize the command/reply array
Dim state As Integer
Dim FirstTime As Boolean
Dim CancelFlag As Boolean
Dim akm As Integer
Dim ama As Integer
Dim aza As String
Dim Nr1 As Integer, Nr2 As Integer, num1 As String
Dim LocalIP As String
Dim prts As String
Dim bReplied As Boolean
Dim lTime As Long
Dim MessCnt As Integer
Dim t As Integer
Dim restr As String
Dim numberof As Integer
Dim rmdata As String, trans
Dim x1, y1 As Integer
Sub ButtonUp(Index)
CoolBarImage(Index).Left = CoolBarImage(Index).Left - 10
CoolBarImage(Index).Top = CoolBarImage(Index).Top - 10
Coolbar(Index).Left = Coolbar(Index).Left - 10
Coolbar(Index).Top = Coolbar(Index).Top - 10
Coolbar(Index).Height = Coolbar(Index).Height + 40
Coolbar(Index).Width = Coolbar(Index).Width + 40
   
End Sub
Sub ButtonDown(Index)
Label3.Caption = ""
CoolBarImage(Index).Left = CoolBarImage(Index).Left + 10
CoolBarImage(Index).Top = CoolBarImage(Index).Top + 10
Coolbar(Index).Left = Coolbar(Index).Left + 10
Coolbar(Index).Top = Coolbar(Index).Top + 10
Coolbar(Index).Height = Coolbar(Index).Height - 40
Coolbar(Index).Width = Coolbar(Index).Width - 40
   
End Sub
Sub MoveMouse(Index)
If Index <> PrevButton Then
    On Error Resume Next
        Coolbar(PrevButton).BorderStyle = 0
End If
   
    PrevButton = Index
    Coolbar(Index).BorderStyle = 1
    CoolBarImage(Index).Visible = True

End Sub
Function loadSaved() As Boolean
Dim ans As String
chgDirRm = getstring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "RemoteDir")
chgDirLc = getstring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "LocalDir")
ans = getstring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "Usemask")
If ans = "" Or ans = "No" Then
UseMask.Value = 0
End If
If ans = "Yes" Then
UseMask.Value = 1
End If

ans = getstring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "UsemaskLocal")
If ans = "" Or ans = "No" Then
chkLc.Value = 0
Remote_mask = ""
End If
If ans = "Yes" Then
chkLc.Value = 1
ans = getstring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "Local")
Local_mask = ans
End If

ans = getstring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "UsemaskRemote")
If ans = "" Or ans = "No" Then
chkRm.Value = 0
Remote_mask = ""
End If
If ans = "Yes" Then
chkRm.Value = 1
ans = getstring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "Remote")
Remote_mask = ans
End If

ans = getstring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "PlaySound")
If ans = "" Or ans = "Yes" Then
chkSounds.Value = 1
End If
If ans = "No" Then
chkSounds.Value = 0
End If

End Function
Function SendFile()
Dim temp As String
If doing_multi = False Then
cmdCancel.Enabled = True
End If
If halt_transfer = True Then
Progress.Position = 0
Exit Function
End If

Buffer = 4096
If doing_multi = False Then
Progress.Max = LOF(10)
End If
client.total_size = LOF(10)
multiMove.ProgressBar1.Max = (LOF(10) / 100)

With client
If Buffer > (.total_size - .transferBytesSent) Then
            Buffer = (.total_size - .transferBytesSent)
        End If
temp = Space$(Buffer)
        Get 10, , temp
.transferBytesSent = .transferBytesSent + Buffer
.transferTotalBytes = .transferTotalBytes + Buffer
trans = trans + .transferTotalBytes
If doing_multi = False Then
Progress.Position = .transferTotalBytes
Else
trans = trans / 100
multiMove.ProgressBar1.Position = trans
End If
End With
data.SendData temp

End Function
Sub WaitFor(WaitFor As String)
On Error Resume Next
Do While Response <> WaitFor
DoEvents
Loop

Response = 0
End Sub
Public Sub open_file(filename As String)
On Error GoTo here

    If Right(Local_Dir, 2) = "\\" Then
    Local_Dir = Mid(Local_Dir, 1, Len(Local_Dir) - 1)
    End If
    Open (Local_Dir & restr) For Binary Access Write As #1

here:
DoEvents
End Sub
Public Sub Connect()
Dim J
On Error GoTo wrongnum
J = FTPLogin.Host.Text
ServerLog.Clear
state = 0
con.Close
data.Close
Call ipeer
With con
.RemoteHost = J
.RemotePort = FTPLogin.Text1.Text
.LocalPort = Int(Rnd * 99) + 5
.Connect
End With

lTime = 0
    While (Not bReplied) And (lTime < 250000)
        DoEvents
        lTime = lTime + 1
    Wend
   
    If lTime >= 250000 Then
    MsgBox "    Unable to Connect to Host.     ": DoEvents
    lTime = 0
       con.Close
        Unload FTPLogin
    End If
    Exit Sub
   
wrongnum:
Call Wait(0.25)
   
J = FTPLogin.Host.Text
ServerLog.Clear
state = 0
con.Close
data.Close
Call ipeer
With con
.RemoteHost = J
.RemotePort = FTPLogin.Text1.Text
.LocalPort = Int(Rnd * 99) + 5
.Connect
End With

lTime = 0
    While (Not bReplied) And (lTime < 250000)
        DoEvents
        lTime = lTime + 1
    Wend
   
    If lTime >= 250000 Then
    MsgBox "    Unable to Connect to Host.     ": DoEvents
    lTime = 0
       con.Close
        Unload FTPLogin
    End If
    Exit Sub
   
End Sub
Public Sub Disconnect()
ServerLog.Clear
RemoteFiles.Clear
RemoteDirectories.Clear
isit = False
If con.state = sckConnected Then
con.SendData "QUIT" + Chr(13) + Chr(10)
End If
End Sub
Sub ipeer()
On Error GoTo tryagain
data.Close
     LocalIP = con.LocalIP
      Do Until InStr(LocalIP, ".") = 0
           LocalIP = Left(LocalIP, InStr(LocalIP, ".") - 1) + "," + Right(LocalIP, Len(LocalIP) - InStr(LocalIP, "."))
       Loop
       

       Randomize Timer
       Nr1 = Int(Rnd * 12) + 5
       Nr2 = Int(Rnd * 254) + 1
       num1 = "PORT " + LocalIP + "," + Trim(str(Nr1)) + "," + Trim(str(Nr2))
       prts = num1
       data.LocalPort = (Nr1 * 256) + Nr2
       data.RemotePort = Trim(str(Nr2)) ' was nr1
       data.Close
       data.Listen
       Exit Sub
       
tryagain:
Call Wait(0.25)
     data.Close
     LocalIP = con.LocalIP
      Do Until InStr(LocalIP, ".") = 0
           LocalIP = Left(LocalIP, InStr(LocalIP, ".") - 1) + "," + Right(LocalIP, Len(LocalIP) - InStr(LocalIP, "."))
       Loop
       

       Randomize Timer
       Nr1 = Int(Rnd * 12) + 5
       Nr2 = Int(Rnd * 254) + 1
       num1 = "PORT " + LocalIP + "," + Trim(str(Nr1)) + "," + Trim(str(Nr2))
       prts = num1
       data.LocalPort = (Nr1 * 256) + Nr2
       data.RemotePort = Trim(str(Nr2)) ' was nr1
       data.Close
       data.Listen
End Sub
Sub sdelem()

akm = RemoteFiles.ListCount - 1
ama = RemoteFiles.SelCount
Dim anss As String
Dim Cancel1 As Boolean
anss = MsgBox("Delete " & ama & " Files on Remote System?", _
    vbOKCancel + vbQuestion, "Delete Files"): DoEvents
If anss = vbOK Then
    Cancel1 = False
Else

    Cancel1 = True
    GoTo iohoh
End If
dir_info = ""
Screen.MousePointer = vbHourglass

Dim Y
For Y = 0 To akm
If RemoteFiles.Selected(Y) Then
restr = " " & RemoteFiles.List(Y)
restr = Parse(restr, 1)
con.SendData "DELE " & restr + Chr(13) + Chr(10)
End If
WaitFor (250)
Call Wait(0.125)
Next

doing_multi = False
con.SendData "TYPE A" + Chr(13) + Chr(10)
WaitFor (200)
con.SendData "PWD " + Chr(13) + Chr(10)

Screen.MousePointer = vbDefault
iohoh:
End Sub
Sub delem()
akm = 0
ama = LocalFiles.SelCount
Dim ans As Integer
Dim Cancel As Boolean
ans = MsgBox("Delete " & ama & " Files on Local System?", _
    vbOKCancel + vbQuestion, "Delete Files"): DoEvents
If ans = vbOK Then
    Cancel = False
Else

    Cancel = True
    GoTo ohoh
End If
Screen.MousePointer = vbHourglass

Dim Y, ret As Boolean
Y = 0
Do Until Y = LocalFiles.ListCount
If LocalFiles.Selected(Y) Then
ret = ShellDelete(Local_Dir & LocalFiles.List(Y) & Chr(0), FOF_SILENT & FOF_ALLOWUNDO, "")
End If
Y = Y + 1
Call Wait(0.25)
Loop

Screen.MousePointer = 0
RefreshLocal
ohoh:
End Sub
Sub Wait(WaitSeconds As Single)

Dim StartTime As Single

StartTime = Timer

Do While Timer < StartTime + WaitSeconds
DoEvents
Loop
End Sub
Sub RefreshAll()

    RefreshLocal
    RefreshRemote
   
End Sub


Sub RefreshLocal()

    Screen.MousePointer = vbHourglass

Dim NextLocal As String
Dim FullSpec As String
   
    LocalPWD.Caption = CurDir()
    Local_Dir = CurDir()
    Local_Dir = Local_Dir & "\"
    LocalDirectories.Clear
    LocalFiles.Clear
    If Len(CurDir()) = 3 Then
        FullSpec = CurDir() & "*.*"
    Else
        FullSpec = CurDir() & "\*.*"
    End If
    NextLocal = Dir(FullSpec, vbDirectory + vbNormal)
    Do While NextLocal <> ""
        If Len(CurDir()) = 3 Then
            FullSpec = CurDir() & NextLocal
        Else
            FullSpec = CurDir() & "\" & NextLocal
        End If
        On Error Resume Next
       
        If (GetAttr(FullSpec) And vbDirectory) = vbDirectory Then
            LocalDirectories.AddItem NextLocal
        Else
       
        If UseMask.Value = 1 Then
        If chkLc.Value = 1 Then
        If Len(Local_mask) > 3 Then
        masc = "*.*"
        LocalFiles.AddItem NextLocal
        GoTo doit
        End If
        masc = Local_mask
        If masc = "*.*" Then
        LocalFiles.AddItem NextLocal
        GoTo doit
        End If
        If Right(NextLocal, 3) = UCase(masc) Or Right(NextLocal, 3) = LCase(masc) Then
        LocalFiles.AddItem NextLocal
        GoTo doit
        Else
        GoTo doit
        End If
        LocalFiles.AddItem NextLocal
        Else
        LocalFiles.AddItem NextLocal
        End If
        Else
            LocalFiles.AddItem NextLocal
            End If
           
           
        End If
doit:

        NextLocal = Dir
    Loop

    Screen.MousePointer = vbDefault

End Sub

Sub RefreshRemote()
   
    Screen.MousePointer = vbHourglass
    RemoteDirectories.Clear
    RemoteFiles.Clear
    Screen.MousePointer = vbDefault

End Sub

Private Sub ASCIIMode_Click()

    If ASCIIMode.Value = True Then
        FTP.BINARY = False
    End If
   
End Sub

Private Sub BinaryMode_Click()

    If BinaryMode.Value = True Then
        FTP.BINARY = True
    End If
   
End Sub

Private Sub cmdCancel_Click()
If Doing_Upload = True Then
con.SendData "ABOR " + Chr(13) + Chr(10)
halt_transfer = True
Close #10
End If
If Doing_Download = True Then
con.SendData "ABOR " + Chr(13) + Chr(10)
End If
End Sub

Private Sub cmdHelp_Click()
vHelp& = WinHelp(Main.hWnd, App.HelpFile, HELP_INDEX, CLng(0))
End Sub

Private Sub cmdLocal_Click()
Dim ret
ret = BrowseForFolder(Me.hWnd, "Testing")
If ret = "" Then Exit Sub
chgDirLc = ret
End Sub

Private Sub cmdOpt_Click()
If OptFrame.Visible = False Then
OptFrame.Visible = True
Remote.Visible = False
Else
OptFrame.Visible = False
Remote.Visible = True
End If
End Sub

Private Sub cmdRefrLocal_Click()
RefreshLocal
End Sub

Private Sub cmdRefrRemote_Click()
If con.state <> sckConnected Then Exit Sub
On Error GoTo tere
Doing_list = True
dir_info = ""
Call ipeer
con.SendData "TYPE A" + Chr(13) + Chr(10)
WaitFor (200)
con.SendData "PWD " + Chr(13) + Chr(10)
WaitFor (257)
con.SendData prts + Chr(13) + Chr(10)
WaitFor (200)
con.SendData "LIST" + Chr(13) + Chr(10)
Exit Sub
tere:
Doing_list = False
Me.MousePointer = 0
End Sub

Private Sub cmdSave_Click()
If chgDirRm.Text <> "" Then
Call savestring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "RemoteDir", chgDirRm.Text)
Else
Call savestring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "RemoteDir", "")
End If

If chgDirLc.Text <> "" Then
Call savestring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "LocalDir", chgDirLc.Text)
Else
Call savestring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "LocalDir", "")
End If

If UseMask.Value = 1 Then
Call savestring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "Usemask", "Yes")
If chkLc.Value = 1 Then
Call savestring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "UsemaskLocal", "Yes")
Call savestring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "Local", Local_mask)
Else
Call savestring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "UsemaskLocal", "No")
End If
If chkRm.Value = 1 Then
Call savestring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "UsemaskRemote", "Yes")
Call savestring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "Remote", Remote_mask)
Else
Call savestring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "UsemaskRemote", "No")
End If
End If

If UseMask.Value = 0 Then
Call savestring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "Usemask", "No")
Call savestring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "UsemaskLocal", "No")
Call savestring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "UsemaskRemote", "No")
End If

If chkSounds.Value = 1 Then
Call savestring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "PlaySound", "Yes")
Else
Call savestring(HKEY_CURRENT_USER, "Software\Homeplay\HPFTP", "PlaySound", "No")
End If
End Sub

Private Sub Command1_Click()
If con.state <> sckConnected Then Exit Sub
On Error GoTo tere
Doing_list = True
dir_info = ""
Call ipeer
con.SendData "TYPE A" + Chr(13) + Chr(10)
WaitFor (200)
con.SendData "PWD " + Chr(13) + Chr(10)
WaitFor (257)
con.SendData prts + Chr(13) + Chr(10)
WaitFor (200)
con.SendData "LIST" + Chr(13) + Chr(10)
RefreshLocal
Exit Sub
tere:
Doing_list = False
Me.MousePointer = 0
End Sub

Private Sub Command2_Click()
On Error GoTo Bottom
frmInfo.txtInf.Text = dir_info
frmInfo.Show
Exit Sub
Bottom:
If Err.Number = 7 Then
MsgBox "Directory to large to list..."
End If
End Sub

Private Sub con_Close()
servu = False
testdir = ""
testfile = ""
Main.Caption = "Dis-Connected"
End Sub

Private Sub con_Connect()
Main.Caption = "Connected - " & con.RemoteHostIP
End Sub

Private Sub con_DataArrival(ByVal bytesTotal As Long)
Dim tmps As String
Dim tri As Integer
Dim tre As String
Dim var As Variant
Dim leng As Integer
Dim ret As Boolean
Dim tmpArray() As String
States(0).BackCode = "220"
States(0).Command = "USER " + FTPLogin.UserName.Text
States(1).BackCode = "331"
States(1).Command = "PASS " + FTPLogin.Password.Text
States(2).BackCode = "230"
States(2).Command = "SYST"
States(3).BackCode = "215"
States(3).Command = "TYPE A"
States(4).BackCode = "200"
If chgDirRm.Text = "" Then
States(4).Command = "PWD "
Else
States(4).Command = ("CWD " + chgDirRm.Text + Chr(13) + Chr(10))
End If
       con.GetData tmps, , bytesTotal
       leng = Len(tmps)
       leng = leng - 4
       tri = Len(tmps)
       tre = Mid(tmps, 1, (tri - 2))
       Response = Mid(tmps, 1, 3)
       
       If Mid(tmps, 1, 3) <> 220 Then  ' Server message and Help
       If Mid(tmps, 1, 3) = 214 Then
       GoTo skip
       End If
       If Mid(tmps, 1, 3) = 530 Then   ' Error message
       GoTo skip
       End If
       If Mid(tmps, 1, 3) = 257 Then   ' pwd message
       GoTo skip
       End If
       If Mid(tmps, 1, 3) = 221 Then   ' closing message
       GoTo skip
       End If
       ServerLog.AddItem tre
skip:
       Else
       If Left(tmps, 3) = "220" Then
       ' Server Welcome Message
           If InStr(1, Mid(tmps, 5, leng), vbCrLf) Then
           tre = vbCrLf & tre ' add one to beginning
           MessCnt = CountStr(tre, " ")
           If MessCnt = 0 Then Exit Sub
           ret = Parse2Array(tre, tmpArray(), vbCrLf)
           For t = 1 To MessCnt
           ServerLog.AddItem Mid(tmpArray(t), 2, Len(tmpArray(t)))
           If Mid(Mid(tmpArray(t), 2, Len(tmpArray(t))), 1, 10) = "220-Serv-U" Then ' SERV-U sends different path than War-ftp, mine is also compatable to war...,  go figure!
           servu = True
           End If
           Next
           Else
           ServerLog.AddItem tre
           End If
           End If
       End If
       
       If state < 5 Then
       If chgDirLc.Text <> "" Then
       ChDir chgDirLc.Text
       End If
       If state = 3 Then
       Doing_list = True
       Unload FTPLogin
       End If
           If Left(tmps, 3) = States(state).BackCode Then
           Label3.ForeColor = &HFFFFFF
           Label3.Caption = Mid(tmps, 5, Len(tmps) - 5)
           bReplied = True
               con.SendData States(state).Command + Chr(13) + Chr(10)
               Debug.Print States(state).Command + Chr(13) + Chr(10)
               state = state + 1
               Exit Sub
           Else
           End If
           End If
           
           If Left(tmps, 4) = "LIST" Then
           Doing_list = True
           End If
           
           If Left(tmps, 4) = "150 " Then
           If InStr(1, tmps, "/bin/ls.") Then
           GoTo skipper
           End If
               If Doing_Download = True Then
               client.total_size = Val(Right(tmps, Len(tmps) - InStr(tmps, "(")))
               open_file (RemoteFiles.Text)
               End If
               Exit Sub
skipper:
           End If
           
           
           If Left(tmps, 4) = "214 " Then
           ServerLog.AddItem "214 Help:"
           ServerLog.AddItem tre
           End If
           
           
           If Left(tmps, 4) = "221 " Then
           ServerLog.AddItem "Socket Closed"
           ServerLog.AddItem Mid(tmps, 1, Len(tmps) - 2)
           state = 0
           Do Until con.state <> sckConnected
           Call Wait(0.1)
           Loop
           con.Close
           data.Close
           End If
 
           If Left(tmps, 4) = "226 " Then
           Label3.ForeColor = &HFFFFFF
           Label3.Caption = Mid(tmps, 5, Len(tmps) - 5)
           Close #1
           Me.MousePointer = 0
           If doing_multi = False Then
           client.transferTotalBytes = 0
           trans = 0
           End If
           Progress.Position = 0
           ServerLog.AddItem "Done..."
           data.Close
           cmdCancel.Enabled = False
           
           If halt_transfer = True Then
           ServerLog.AddItem "226 Transfer aborted."
           halt_transfer = False
           Exit Sub
           End If
           
           If Doing_list = True Then
           Doing_list = False
           Exit Sub
           End If
           
           If Doing_Upload = True Then
           Doing_Upload = False
           ServerLog.AddItem "PWD"
           con.SendData "TYPE A" + Chr(13) + Chr(10)
           WaitFor (200)
           con.SendData ("PWD" + Chr(13) + Chr(10))
           'If chkSounds.Value = 1 Then
           'BeginPlaySound (103)
           'End If
           Exit Sub
           End If
           
           If Doing_Download = True Then
           'If chkSounds.Value = 1 Then
           'BeginPlaySound (103)
           'End If
           RefreshLocal
           Doing_Download = False
           End If
           End If
           
           If Left(tmps, 4) = "250 " Then
           Label3.ForeColor = &HFFFFFF
           Label3.Caption = Mid(tmps, 5, Len(tmps) - 5)
           If doing_multi = False Then
           ServerLog.AddItem "PWD"
           con.SendData "TYPE A" + Chr(13) + Chr(10)
           WaitFor (200)
           con.SendData ("PWD" + Chr(13) + Chr(10))
           End If
           End If
           
           If Left(tmps, 4) = "257 " Then
           Main.Caption = "Doing List"
           Label3.ForeColor = &HFFFFFF
           Label3.Caption = Mid(tmps, 5, Len(tmps) - 5)
           dir_info = ""
           
           'If chkSounds.Value = 1 Then
               'BeginPlaySound (101)
           'End If
           
           If create_dir = True Then
           create_dir = False
           GoTo jump
           End If
           
           If remove_dir = True Then
           remove_dir = False
           GoTo jump
           End If
           
           If servu = False Then
           remote_dir = Mid(tmps, 6, Len(tmps) - 30)
           RemotePWD.Text = remote_dir
           prevPath = Splitpath(remote_dir, 2)
           ServerLog.AddItem "257 " & Mid(tmps, 6, Len(tmps) - 30) & " is working directory"
           End If
           
           If servu = True Then
           If Len(tmps) <= 30 Then
           remote_dir = Mid(tmps, 6, 1)
           GoTo skiper
           End If
           
           remote_dir = Mid(tmps, 7, Len(tmps) - 30)
           ServerLog.AddItem "257 " & Mid(tmps, 6, Len(tmps) - 30) & " is working directory"
           RemotePWD.Text = remote_dir
           prevPath = Splitpath(remote_dir, 2)
           GoTo jump
skiper:
           RemotePWD.Text = remote_dir
           RemoteDirectories.AddItem Mid(tmps, 6, 1)
           ServerLog.AddItem "257 " & Mid(tmps, 6, 1) & " is working directory"
           End If
           
jump:
           Call ipeer
           con.SendData (prts + Chr(13) + Chr(10))
           Doing_list = True
           Call WaitFor(200)
           testdir = ""
           testfile = ""
           Main.RemoteDirectories.Clear
           Main.RemoteFiles.Clear
           Main.RemoteDirectories.AddItem ".."
           con.SendData ("LIST " + Chr(13) + Chr(10))
           End If
           
           If Left(tmps, 4) = "425 " Then
           Label3.ForeColor = &HFFFFFF
           Label3.Caption = Mid(tmps, 5, Len(tmps) - 5)
           Me.MousePointer = 0
           data.Close
           con.SendData "TYPE A" + Chr(13) + Chr(10)
           WaitFor (200)
           con.SendData ("PWD " + Chr(13) + Chr(10))
           End If
           
           If Left(tmps, 4) = "426 " Then
           If chkSounds.Value = 1 Then
           BeginPlaySound (102)
           End If
           data.Close
           End If
           
           If Left(tmps, 4) = "530 " Then
           Label3.ForeColor = &HFF&
           Label3.Caption = Mid(tmps, 5, Len(tmps) - 5)
           con.Close
           state = 8
           If chkSounds.Value = 1 Then
           BeginPlaySound (102)
           End If
           End If
           
           If Left(tmps, 4) = "550 " Then
           If chkSounds.Value = 1 Then
           BeginPlaySound (102)
           End If
           Label3.ForeColor = &HFF&
           Label3.Caption = Mid(tmps, 5, Len(tmps) - 5)
           Me.MousePointer = 0
           
           If Doing_list = True Then
           Doing_list = False
           data.Close
           Exit Sub
           End If
           
           If Doing_Download = True Then
           Doing_Download = False
           Close #1
           data.Close
           If multiMove.Visible = True Then
           Unload multiMove
           End If
           Exit Sub
           End If
           
           If Doing_Upload = True Then
           Close #10
           Doing_Upload = False
           data.Close
           If multiMove.Visible = True Then
           Unload multiMove
           End If
           Exit Sub
           End If
           
           If remove_dir = True Then
           remove_dir = False
           Exit Sub
           End If
           data.Close
           Me.MousePointer = 0
           End If
           
           
           

End Sub

Private Sub Coolbar_Click(Index As Integer)
Dim II, size As Long, si As Long, nam As Long
Dim w As Integer
Dim r As Integer
r = Index


Select Case r
Case "0"
If isit = True Then
Beep
GoTo skipper
End If
FTPLogin.Show
skipper:

Case "1"
Call Disconnect
FTPLogin.OK.Enabled = True
FTPLogin.Cancel.Enabled = True
testdir = ""
testfile = ""

Case "2"
On Error GoTo getout
If RemoteFiles.SelCount = 0 Then
Beep
Exit Sub
End If

Main.Caption = "Doing Download"
numberof = 1
trans = 0
client.transferTotalBytes = 0
halt_transfer = False

If RemoteFiles.SelCount = 1 Then
doing_multi = False
Doing_Download = True
restr = " " & RemoteFiles.Text
client.total_size = Parse(restr, 2)
Progress.Max = client.total_size
restr = Parse(restr, 1)
client.File_Name = restr
ServerLog.AddItem "Receiving " & restr & " as " & restr & " (1 of 1)"
con.SendData "TYPE I" + Chr(13) + Chr(10)
Call ipeer
WaitFor (200)
con.SendData prts + Chr(13) + Chr(10)
WaitFor (200)
con.SendData "RETR " & restr + Chr(13) + Chr(10)

ElseIf RemoteFiles.SelCount > 1 Then
For II = 0 To RemoteFiles.ListCount - 1
si = 0
If RemoteFiles.Selected(II) Then
restr = " " & RemoteFiles.List(II)
si = Parse(restr, 2)
si = si / 100
size = size + si
End If
Next
multiMove.ProgressBar1.Max = size

doing_multi = True

    For II = 0 To RemoteFiles.ListCount - 1
    Doing_Download = True
        If RemoteFiles.Selected(II) Then
        restr = " " & RemoteFiles.List(II)
        client.total_size = Parse(restr, 2)
        restr = Parse(restr, 1)
        client.File_Name = restr
        multiMove.lblNumber = "Moving " & numberof & " of " & RemoteFiles.SelCount & " Files"
        multiMove.lblInfo = "Receiving File: " & restr & "  " & client.total_size & " Bytes"
        multiMove.Show
        ServerLog.AddItem "Receiving " & restr & " as " & restr & "(" & numberof & " of " & RemoteFiles.SelCount & ")"
        con.SendData "TYPE I" + Chr(13) + Chr(10)
        Call ipeer
        WaitFor (200)
        con.SendData prts + Chr(13) + Chr(10)
        WaitFor (200)
        con.SendData "RETR " & restr + Chr(13) + Chr(10)
        WaitFor (226)
        numberof = numberof + 1
        Call Wait(0.25)
        End If
    Next II
    multiMove.lblNumber = "Transfer Complete"
    multiMove.lblInfo = ""
doing_multi = False
size = 0
Call Wait(0.75)
Unload multiMove
RefreshLocal
End If
Exit Sub

getout:
data.Close
Doing_Download = False
doing_multi = False

Case "3"
If LocalFiles.SelCount = 0 Then
Beep
Exit Sub
End If

Main.Caption = "Doing Upload"
numberof = 1
trans = 0
halt_transfer = False
dir_info = ""
client.transferTotalBytes = 0
Dim inn As Integer
inn = LocalFiles.SelCount

If inn = 1 Then
doing_multi = False
If Right(Local_Dir, 2) = "\\" Then
Local_Dir = Mid(Local_Dir, 1, Len(Local_Dir) - 1)
End If

Open (Local_Dir & LocalFiles.Text) For Binary As #10
With client
.total_size = 0
.transferBytesSent = 0
.currentFile = LocalFiles.Text
End With

Doing_Upload = True
  con.SendData "TYPE I" + Chr(13) + Chr(10)
  Call ipeer
  WaitFor (200)
  con.SendData prts + Chr(13) + Chr(10)
  WaitFor (200)
  con.SendData "STOR " & LocalFiles.Text + Chr(13) + Chr(10)
  WaitFor (150)
  SendFile
 
  ElseIf LocalFiles.SelCount > 1 Then
 
If Right(Local_Dir, 2) = "\\" Then
Local_Dir = Mid(Local_Dir, 1, Len(Local_Dir) - 1)
End If

For II = 0 To LocalFiles.ListCount - 1
si = 0
If LocalFiles.Selected(II) Then
Open Local_Dir & LocalFiles.List(II) For Random As #3
si = LOF(3)
Close #3

si = si / 100
size = size + si
End If
Next

multiMove.ProgressBar1.Max = size
doing_multi = True
 
    For II = 0 To LocalFiles.ListCount - 1
    Doing_Upload = True
        If LocalFiles.Selected(II) Then
        restr = LocalFiles.List(II)
        client.File_Name = restr
        If Right(Local_Dir, 2) = "\\" Then
        Local_Dir = Mid(Local_Dir, 1, Len(Local_Dir) - 1)
        End If
        Open (Local_Dir & restr) For Binary As #10
        nam = LOF(10)
        multiMove.lblNumber = "Moving " & numberof & " of " & LocalFiles.SelCount & " Files"
        multiMove.lblInfo = "Sending File: " & restr & "  " & nam & " Bytes"
        multiMove.Show
        ServerLog.AddItem "Sending " & restr & " as " & restr & " (" & numberof & " of " & inn & ")"
        con.SendData "TYPE I" + Chr(13) + Chr(10)
        Call ipeer
        WaitFor (200)
        con.SendData prts + Chr(13) + Chr(10)
        WaitFor (200)
         con.SendData "STOR " & restr + Chr(13) + Chr(10)
         WaitFor (150)
         SendFile
         WaitFor (226)
         numberof = numberof + 1
         Call Wait(0.25)
        End If
    Next II
 
  End If
 
multiMove.lblNumber = "Transfer Complete"
multiMove.lblInfo = ""
multiMove.ProgressBar1.Position = 0
doing_multi = False
size = 0
Call Wait(0.75)
Unload multiMove
RefreshLocal

Case "4"
AboutBox.Show

Case "5"
RemotePWD.Text = ""
Call Disconnect
Call Wait(0.75)
Me.Hide
Call Wait(1)
End

End Select

End Sub

Private Sub Coolbar_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
ButtonDown (Index)
End Sub

Private Sub Coolbar_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
MoveMouse (Index)
End Sub

Private Sub Coolbar_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
ButtonUp (Index)
End Sub

Private Sub CoolBarImage_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
ButtonDown (Index)
End Sub

Private Sub CoolBarImage_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
MoveMouse (Index)
End Sub

Private Sub CoolBarImage_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
ButtonUp (Index)
End Sub

Private Sub data_Close()
Close #1
    data.Close
    Me.MousePointer = 0
    Progress.Position = 0
    Main.Caption = "Connected to " & con.RemoteHostIP
End Sub

Private Sub data_ConnectionRequest(ByVal requestID As Long)
data.Close
data.Accept requestID
End Sub

Private Sub data_DataArrival(ByVal bytesTotal As Long)
Dim k As Integer
cmdCancel.Enabled = True
On Error Resume Next
data.GetData rmdata, , bytesTotal
trans = trans + bytesTotal
client.transferTotalBytes = trans

If doing_multi = False Then
Progress.Position = trans
Else
multiMove.ProgressBar1.Position = (trans / 100)
End If

If Doing_list = True Then
Do Until Response = "226"
dir_info = dir_info & rmdata
Call Wait(0.1)
Loop

Dirlist (dir_info)
Call Wait(0.1)
RemoteDirectories.Refresh
Exit Sub
End If


Put #1, , rmdata

End Sub

Private Sub data_SendComplete()
With client
                If .total_size = .transferBytesSent Then
                    Close #10
                    data.Close
                    .transferBytesSent = 0
                    'If doing_multi = False Then
                    Progress.Position = 0
                    cmdCancel.Enabled = False
                Else
                    SendFile
                End If
    End With

End Sub

Private Sub Drive1_Change()
ChDrive Drive1.Drive
RefreshLocal
End Sub

Private Sub Form_Activate()
If Main.Caption = "Not Connected" Then
GoTo skip
End If
    If FirstTime = False Then
       FirstTime = True
       DoEvents
       RefreshAll
    End If
skip:
End Sub

Private Sub Form_Load()
App.HelpFile = (App.Path & "\" & "ez-ftp.hlp")
akm = 0
    Dim test As Boolean
    Me.Move (Screen.Width \ 2) - (Me.Width \ 2), (Screen.Height \ 2) - (Me.Height \ 2)
    FirstTime = False
    bReplied = False
    Cann = False
    Doing_list = False
    halt_transfer = False
    create_dir = False
    remove_dir = False
    servu = False
    loadSaved
    Call FormEffect(Main, 144, 135, 60, True, True)
    Timer1.Enabled = True
End Sub


Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
If x1 >= Me.Width - 485 And x1 <= Me.Width - 300 And y1 >= 75 And y1 <= 255 Then
        Me.WindowState = 1
    End If
    If x1 >= Me.Width - 275 And x1 <= Me.Width - 90 And y1 >= 75 And y1 <= 255 Then
   RemotePWD.Text = ""
Call Disconnect
Call Wait(0.75)
Me.Hide
Call Wait(1)
End
End If
Dim ReturnVal As Long
                     X = ReleaseCapture()
                     ReturnVal = SendMessage(hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)
End If
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
 On Error Resume Next
    Coolbar(PrevButton).BorderStyle = 0
    CoolBarImage(PrevButton).Visible = True
    PrevButton = -1
    x1 = X
    y1 = Y
End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
LocalFiles.ListIndex = -1
RemoteFiles.ListIndex = -1
LocalDirectories.ListIndex = -1
End If
End Sub

Private Sub Form_Resize()
If Me.WindowState = 1 Then Exit Sub
Me.Width = 7290
Me.Height = 7350
End Sub

Private Sub Form_Unload(Cancel As Integer)
Close #1
    Me.Hide
    If con.state = sckConnected Then
    Call Disconnect
    Else
    con.Close
    data.Close
    End If
    Call Wait(0.75)
    Dim Dummy As String
vHelp& = WinHelp(Main.hWnd, Dummy, HELP_QUIT, 0)
    End
End Sub

Private Sub Frame1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
    Coolbar(PrevButton).BorderStyle = 0
    CoolBarImage(PrevButton).Visible = True
    PrevButton = -1
End Sub

Private Sub Frame2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
    Coolbar(PrevButton).BorderStyle = 0
    CoolBarImage(PrevButton).Visible = True
    PrevButton = -1
End Sub

Private Sub Frame3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
    Coolbar(PrevButton).BorderStyle = 0
    CoolBarImage(PrevButton).Visible = True
    PrevButton = -1
End Sub

Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
    Coolbar(PrevButton).BorderStyle = 0
    CoolBarImage(PrevButton).Visible = True
    PrevButton = -1
End Sub

Private Sub Local_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Dim ReturnVal As Long
                     X = ReleaseCapture()
                     ReturnVal = SendMessage(hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)
End If
End Sub

Private Sub Local_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
    Coolbar(PrevButton).BorderStyle = 0
    CoolBarImage(PrevButton).Visible = True
    PrevButton = -1
End Sub

Private Sub Local_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
LocalFiles.ListIndex = -1
RemoteFiles.ListIndex = -1
LocalDirectories.ListIndex = -1
End If
End Sub

Private Sub LocalCD_Click()

Dim NewDirectory As String

    NewDirectory = InputBox$("Enter directory to change to")
    If NewDirectory = "" Then
        Exit Sub
    End If

    On Error Resume Next
    ChDir NewDirectory
    If Err <> 0 Then
        MsgBox "Unable to change directory", vbExclamation: DoEvents
    Else
        RefreshLocal
    End If
   
End Sub

Private Sub LocalDEL_Click()
Dim ret As Boolean
If LocalFiles.SelCount > 1 Then
Call delem
Exit Sub
End If

ret = ShellDelete(Local_Dir & LocalFiles.Text, FOF_ALLOWUNDO, "")
RefreshLocal
End Sub

Private Sub LocalDirectories_DblClick()
    If LocalDirectories.ListIndex = -1 Then
        Beep
        Exit Sub
    End If
    doing_multi = False
    ChDir LocalDirectories.Text
    RefreshLocal
   
End Sub


Private Sub LocalDirectories_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
    Coolbar(PrevButton).BorderStyle = 0
    CoolBarImage(PrevButton).Visible = True
    PrevButton = -1
End Sub

Private Sub LocalDirectories_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
RemoteFiles.ListIndex = -1
End Sub

Private Sub LocalFiles_DblClick()
If con.state <> sckConnected Then Exit Sub
On Error GoTo airr
If Right(Local_Dir, 2) = "\\" Then
Local_Dir = Mid(Local_Dir, 1, Len(Local_Dir) - 1)
End If
Open (Local_Dir & LocalFiles.Text) For Binary As #10
doing_multi = False
With client
.total_size = 0
.transferBytesSent = 0
.currentFile = LocalFiles.Text
End With
Doing_Upload = True
  con.SendData "TYPE I" + Chr(13) + Chr(10)
  Call ipeer
  WaitFor (200)
  con.SendData prts + Chr(13) + Chr(10)
  WaitFor (200)
  con.SendData "STOR " & LocalFiles.Text + Chr(13) + Chr(10)
  WaitFor (150)
  SendFile
  Exit Sub
airr:
  If Err.Number = 40006 Then
 MsgBox "       Not Connected          ": DoEvents
Else
MsgBox "There was an Error - #" & Err.Number: DoEvents
End If
Close #10
End Sub


Private Sub LocalFiles_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
RemoteFiles.ListIndex = -1
LocalDirectories.ListIndex = -1
End If
End Sub

Private Sub LocalFiles_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
    Coolbar(PrevButton).BorderStyle = 0
    CoolBarImage(PrevButton).Visible = True
    PrevButton = -1
End Sub

Private Sub LocalMD_Click()

Dim NewDirectory As String
   
    NewDirectory = InputBox$("Enter new directory name")
    If NewDirectory = "" Then
        Exit Sub
    End If
   
    On Error Resume Next
    MkDir NewDirectory
    If Err <> 0 Then
        MsgBox "Unable to make local directory", vbExclamation: DoEvents
    Else
        RefreshLocal
    End If

End Sub

Private Sub LocalRD_Click()
Dim ans As Integer
Dim Cancel As Boolean
ans = MsgBox("Remove Directory from Local System?", _
    vbOKCancel + vbQuestion, "Remove Directory"): DoEvents
If ans = vbOK Then
    Cancel = False
Else

    Cancel = True
    GoTo bherr
End If
    If LocalDirectories.ListIndex = -1 Then
        Beep
        Exit Sub
    End If
   
    On Error Resume Next
    RmDir LocalDirectories.Text
    If Err <> 0 Then
        MsgBox "Unable to remove local directory", vbExclamation: DoEvents
    Else
        RefreshLocal
    End If
bherr:
End Sub

Private Sub OptFrame_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
    Coolbar(PrevButton).BorderStyle = 0
    CoolBarImage(PrevButton).Visible = True
    PrevButton = -1
End Sub

Private Sub Remote_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Dim ReturnVal As Long
                     X = ReleaseCapture()
                     ReturnVal = SendMessage(hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)
End If
End Sub

Private Sub Remote_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
    Coolbar(PrevButton).BorderStyle = 0
    CoolBarImage(PrevButton).Visible = True
    PrevButton = -1
End Sub

Private Sub Remote_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
LocalFiles.ListIndex = -1
RemoteFiles.ListIndex = -1
LocalDirectories.ListIndex = -1
End If
End Sub

Private Sub RemoteCD_Click()
On Error GoTo cherr
Dim ans As Integer
Dim Cancel As Boolean
ans = MsgBox("Change Directory on Server?", _
    vbOKCancel + vbQuestion, "Change Directory"): DoEvents
If ans = vbOK Then
    Cancel = False
Else

    Cancel = True
    GoTo cherr
End If
Dim NewDirectory As String

    NewDirectory = InputBox$("Enter directory to change to")
    If NewDirectory = "" Then
        Exit Sub
    End If
    If con.state = sckConnected Then
    con.SendData ("CWD " & NewDirectory & " " & Chr(13) + Chr(10))
    End If

cherr:
End Sub

Private Sub RemoteDEL_Click()
If RemoteFiles.SelCount > 1 Then
doing_multi = True
Call sdelem
Exit Sub
End If

Dim ans As Integer
Dim Cancel As Boolean

If RemoteFiles.ListIndex = -1 Then
MsgBox "You Must Select a File on the Server First!": DoEvents
Exit Sub
End If

doing_multi = False

Dim str1 As String, str2 As String
dir_info = ""
str1 = " " & RemoteFiles.Text


str2 = Parse(str1, 2)
str1 = Parse(str1, 1)

ans = MsgBox("Delete " & str1 & " - " & str2 & " bytes," & " from Server?", _
    vbOKCancel + vbQuestion, "Delete File"): DoEvents
If ans = vbOK Then
    Cancel = False
Else

    Cancel = True
    GoTo herr
End If
If con.state = sckConnected Then
Main.Caption = "Doing Delete"
con.SendData "DELE " & str1 + Chr(13) + Chr(10)
End If
   
herr:
End Sub

Private Sub RemoteDirectories_DblClick()
On Error Resume Next
If con.state <> sckConnected Then Exit Sub
If RemoteDirectories.Text = remote_dir Then Exit Sub
doing_multi = False
Doing_list = True
'MsgBox remote_dir

If RemoteDirectories = ".." Then
Doing_list = True
RemoteFiles.Clear
RemoteDirectories.Clear
con.SendData ("CDUP " + Chr(13) + Chr(10))
Exit Sub
End If

Me.MousePointer = 11
If Mid(RemoteDirectories.Text, 1, 1) = " " Then
remote_dir = Mid(RemoteDirectories.Text, 2, Len(RemoteDirectories.Text) - 1)
Else
remote_dir = RemoteDirectories.Text
End If
    On Error Resume Next
    con.SendData ("CWD " + remote_dir + Chr(13) + Chr(10))
   
   
    If Err <> 0 Then
        MsgBox "Unable to change directory", vbExclamation: DoEvents
    Else
        RefreshRemote
    End If
   
End Sub


Private Sub RemoteDirectories_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
    Coolbar(PrevButton).BorderStyle = 0
    CoolBarImage(PrevButton).Visible = True
    PrevButton = -1
End Sub

Private Sub RemoteFiles_DblClick()
If con.state <> sckConnected Then Exit Sub
Me.MousePointer = 11
Doing_Download = True
doing_multi = False
restr = " " & RemoteFiles.Text
client.total_size = Parse(restr, 2)
Progress.Max = client.total_size
restr = Parse(restr, 1)
client.File_Name = restr
ServerLog.AddItem "Receiving " & restr & " as " & restr & " (1 of 1)"
Main.Caption = "Doing Download"
con.SendData "TYPE I" + Chr(13) + Chr(10)
Call ipeer
WaitFor (200)
con.SendData prts + Chr(13) + Chr(10)
WaitFor (200)
con.SendData "RETR " & restr + Chr(13) + Chr(10)
End Sub


Private Sub RemoteFiles_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
    Coolbar(PrevButton).BorderStyle = 0
    CoolBarImage(PrevButton).Visible = True
    PrevButton = -1
End Sub

Private Sub RemoteFiles_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
LocalFiles.ListIndex = -1
LocalDirectories.ListIndex = -1
End If
End Sub

Private Sub RemoteMD_Click()
On Error GoTo gherr
Dim ans As Integer
Dim Cancel As Boolean
ans = MsgBox("Create Directory on Server?", _
    vbOKCancel + vbQuestion, "Create Directory"): DoEvents
If ans = vbOK Then
    Cancel = False
Else

    Cancel = True
    GoTo gherr
End If
Dim NewDirectory As String
   
    NewDirectory = InputBox$("Enter new directory name"): DoEvents
    If NewDirectory = "" Then
        Exit Sub
    End If
    create_dir = True
    If con.state = sckConnected Then
    con.SendData ("MKD " + NewDirectory + Chr(13) + Chr(10))
    End If
   
 Exit Sub
gherr:

End Sub

Private Sub RemotePWD_KeyPress(KeyAscii As Integer)
Dim patlen As Integer, truth As String
On Error GoTo bott
If KeyAscii = 13 Then
patlen = Len(remote_dir)
truth = RemotePWD.Text
dir_info = ""
If con.state = sckConnected Then
con.SendData ("CWD " + truth + Chr(13) + Chr(10))
End If
KeyAscii = 0
End If
Exit Sub

bott:
On Error Resume Next
con.SendData ("CDUP " + Chr(13) + Chr(10))
KeyAscii = 0
End Sub

Private Sub RemoteRD_Click()
On Error GoTo aherr
Dim shrt As String
Dim ans As Integer
Dim Cancel As Boolean
 If RemoteDirectories.SelCount = 0 Then
        MsgBox "You Must Select a Directory on Server First": DoEvents
        Exit Sub
    End If
 shrt = RemoteDirectories.Text
   
 If Mid(shrt, 1, 1) = " " Then
 shrt = Mid(shrt, 2, Len(shrt) - 1)
 End If
 
ans = MsgBox("Remove Directory " & shrt & " from Server?", _
    vbOKCancel + vbQuestion, "Remove Directory"): DoEvents
If ans = vbOK Then
    Cancel = False
Else

    Cancel = True
    GoTo aherr
End If
remove_dir = True
If con.state = sckConnected Then
con.SendData ("RMD " & shrt + Chr(13) + Chr(10))
End If
 Exit Sub
   
aherr:
End Sub

Private Sub Timer1_Timer()
lblTime.Caption = Time
End Sub

Private Sub Title_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim ReturnVal As Long
                     X = ReleaseCapture()
                     ReturnVal = SendMessage(hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)
End Sub

Private Sub UseMask_Click()
If UseMask.Value = 1 Then
chkLc.Enabled = True
chkRm.Enabled = True
Local_mask.Enabled = True
Remote_mask.Enabled = True
Else
chkLc.Enabled = False
chkRm.Enabled = False
Local_mask.Enabled = False
Remote_mask.Enabled = False
End If
End Sub
[+][-]02/12/01 01:42 PM, ID: 5836235Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Visual Basic Programming
Sign Up Now!
Solution Provided By: mammouth
Participating Experts: 4
Solution Grade: A
 
[+][-]02/13/01 05:14 AM, ID: 5838283Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/13/01 05:15 AM, ID: 5838289Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/16/01 08:18 PM, ID: 5851592Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/16/01 04:28 PM, ID: 5936439Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/25/01 04:20 PM, ID: 6693913Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/27/01 04:29 PM, ID: 6697596Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/31/01 11:05 AM, ID: 6702821Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/01/02 02:59 PM, ID: 6704206Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/03/02 09:04 PM, ID: 6709475Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/04/02 04:44 AM, ID: 6710056Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81