login about faq

What are reasons of a error -1 in the method ChangeRemoteDir?

If sPath = "." Then newRelativePath = "/" newDisplayPath = newRelativePath ElseIf sPath = ".." Then If currentPath = "/" Then newRelativePath = "/" newDisplayPath = newRelativePath Else newRelativePath = getFolderFromPath(tvFolders.Nodes(1).Text, "/") If newRelativePath = "" Then newRelativePath = "/" End If newDisplayPath = newRelativePath End If ElseIf sPath = "../" Then 'This means to stay in the same path and just refresh newRelativePath = currentPath newDisplayPath = newRelativePath Else newRelativePath = sPath If currentPath.Substring(Math.Max(currentPath.Length - 1, 0)) = "/" Then newDisplayPath = currentPath & sPath Else newDisplayPath = currentPath & "/" & sPath End If End If

        '  Set the current directory (on the FTP server)
        '  When logging into an FTP account,
        '  current remote directory is automatically set to the
        '  home directory of the FTP account.  From the FTP client's
        '  perspective, it will be "/", but the absolute path on the
        '  FTP server might be something like "/home/ftp_users/".
        flSuccess = ftp.ChangeRemoteDir(newRelativePath)
        If flSuccess <> 1 Then
            SystemSounds.Beep.Play()
            UpdateLogWithMessage(ftp.LastErrorText)
            UpdateActionStatus("Display Directory Contents Error")
            Me.Cursor = Cursors.Default
            Exit Sub
        End If

asked Nov 19 '15 at 13:24

qwertyuiop's gravatar image

qwertyuiop
1


Look at the contents of the ftp.LastErrorText property to get information about what happened...

link

answered Nov 20 '15 at 09:51

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×43

Asked: Nov 19 '15 at 13:24

Seen: 433 times

Last updated: Nov 20 '15 at 09:51

powered by OSQA