ChangeDirectory Method  

Changes current directory on remote FTP server.


object.ChangeDirectory( Path )


A string value which specifies the directory on the server.

Return Value

A value of zero is returned if the method succeeds. Otherwise, a non-zero error code is returned which indicates the cause of the failure.


The ChangeDirectory method changes the current working directory on the server. This method updates the ServerDirectory property to reflect the new path.


Private Sub cmdChgDir_Click()
    Dim nError As Long
    nError = FileTransfer1.ChangeDirectory(Trim(txtServerDirectory.Text))
    If nError > 0 Then
        MsgBox "ChangeDirectory error: " & nError
    End If 
    txtServerDirectory.Text = FileTransfer1.ServerDirectory
End Sub

See Also

ServerDirectory Property