forked from robinrodricks/FluentFTP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rename.vb
31 lines (26 loc) · 962 Bytes
/
Rename.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Imports System
Imports System.Net
Imports System.Threading
Imports System.Threading.Tasks
Imports FluentFTP
Namespace Examples
Friend Module RenameExample
Sub Rename()
Using conn = New FtpClient("127.0.0.1", "ftptest", "ftptest")
conn.Connect()
' renaming a directory Is dependent on the server! if you attempt it
' And it fails it's not because FluentFTP has a bug!
conn.Rename("/full/or/relative/path/to/src", "/full/or/relative/path/to/dest")
End Using
End Sub
Async Function RenameAsync() As Task
Dim token = New CancellationToken()
Using conn = New FtpClient("127.0.0.1", "ftptest", "ftptest")
Await conn.ConnectAsync(token)
' renaming a directory Is dependent on the server! if you attempt it
' And it fails it's not because FluentFTP has a bug!
Await conn.RenameAsync("/full/or/relative/path/to/src", "/full/or/relative/path/to/dest", token)
End Using
End Function
End Module
End Namespace