forked from robinrodricks/FluentFTP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDereferenceLink.vb
36 lines (30 loc) · 1.04 KB
/
DereferenceLink.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
32
33
34
35
36
Imports System
Imports System.Net
Imports System.Threading
Imports System.Threading.Tasks
Imports FluentFTP
Namespace Examples
Friend Module DereferenceLink
Sub DereferenceLinkExample()
Using conn = New FtpClient("127.0.0.1", "ftptest", "ftptest")
conn.Connect()
conn.MaximumDereferenceCount = 20
For Each item In conn.GetListing(Nothing, FtpListOption.ForceList Or FtpListOption.Modify)
Console.WriteLine(item)
If item.Type = FtpFileSystemObjectType.Link AndAlso item.LinkTarget IsNot Nothing Then
item.LinkObject = conn.DereferenceLink(item)
If item.LinkObject IsNot Nothing Then
Console.WriteLine(item.LinkObject)
End If
End If
Next
For Each item In conn.GetListing(Nothing, FtpListOption.ForceList Or FtpListOption.Modify Or FtpListOption.DerefLinks)
Console.WriteLine(item)
If item.Type = FtpFileSystemObjectType.Link AndAlso item.LinkObject IsNot Nothing Then
Console.WriteLine(item.LinkObject)
End If
Next
End Using
End Sub
End Module
End Namespace