Differences
This shows you the differences between the selected revisions of the page.
| library_session_listdirectory 2017-10-04 | library_session_listdirectory 2026-01-16 (current) | ||
| Line 8: | Line 8: | ||
| <code vbnet *> | <code vbnet *> | ||
| - | Public Function ListDirectory(ByVal path As String) As RemoteDirectoryInfo | + | Public Function ListDirectory(path As String) As RemoteDirectoryInfo |
| </code> | </code> | ||
| Line 33: | Line 33: | ||
| ===== [[example]] Examples ===== | ===== [[example]] Examples ===== | ||
| + | |||
| ==== [[csharp]] C# Example ==== | ==== [[csharp]] C# Example ==== | ||
| <code csharp> | <code csharp> | ||
| Line 51: | Line 52: | ||
| UserName = "user", | UserName = "user", | ||
| Password = "mypassword", | Password = "mypassword", | ||
| - | SshHostKeyFingerprint = "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx..." | + | SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx..." |
| }; | }; | ||
| Line 98: | Line 99: | ||
| .UserName = "user" | .UserName = "user" | ||
| .Password = "mypassword" | .Password = "mypassword" | ||
| - | .SshHostKeyFingerprint = "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx..." | + | .SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx..." |
| End With | End With | ||
| Line 143: | Line 144: | ||
| UserName = "user" | UserName = "user" | ||
| Password = "mypassword" | Password = "mypassword" | ||
| - | SshHostKeyFingerprint = "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" | + | SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx..." |
| } | } | ||
| Line 170: | Line 171: | ||
| exit 0 | exit 0 | ||
| } | } | ||
| - | catch [Exception] | + | catch |
| { | { | ||
| Write-Host "Error: $($_.Exception.Message)" | Write-Host "Error: $($_.Exception.Message)" | ||
| Line 183: | Line 184: | ||
| <code javascript> | <code javascript> | ||
| <job> | <job> | ||
| - | <reference object="WinSCP.Session"/> | + | <reference object="WinSCP.Session"·/> |
| <script language="JScript"> | <script language="JScript"> | ||
| Line 194: | Line 195: | ||
| sessionOptions.UserName = "user"; | sessionOptions.UserName = "user"; | ||
| sessionOptions.Password = "mypassword"; | sessionOptions.Password = "mypassword"; | ||
| - | sessionOptions.SshHostKeyFingerprint = "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx..."; | + | sessionOptions.SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx..."; |
| var session = WScript.CreateObject("WinSCP.Session"); | var session = WScript.CreateObject("WinSCP.Session"); | ||
| Line 205: | Line 206: | ||
| var directoryInfo = session.ListDirectory("/home/martin/public_html") | var directoryInfo = session.ListDirectory("/home/martin/public_html") | ||
| - | for (var enumerator = new Enumerator(directoryInfo.Files); | + | var enumerator = new Enumerator(directoryInfo.Files); |
| - | ··················!enumerator.atEnd(); enumerator.moveNext()) | + | ·······for (; !enumerator.atEnd(); enumerator.moveNext()) |
| { | { | ||
| var fileInfo = enumerator.item(); | var fileInfo = enumerator.item(); | ||
| Line 237: | Line 238: | ||
| <code vb> | <code vb> | ||
| <job> | <job> | ||
| - | <reference object="WinSCP.Session"/> | + | <reference object="WinSCP.Session"·/> |
| <script language="VBScript"> | <script language="VBScript"> | ||
| Line 250: | Line 251: | ||
| .UserName = "user" | .UserName = "user" | ||
| .Password = "mypassword" | .Password = "mypassword" | ||
| - | .SshHostKeyFingerprint = "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" | + | .SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx..." |
| End With | End With | ||
| Line 278: | Line 279: | ||
| ==== Real-Life Examples ==== | ==== Real-Life Examples ==== | ||
| - | * [[script_download_most_recent_file|Downloading the most recent file]]; | + | * [[script_download_most_recent_file|*]]; |
| - | ··* [[library_example_listing_files_matching_wildcard|Listing files matching wildcard]]; | + | * [[script_custom_listing_format_csv|*]]. |
| - | * [[library_example_recursive_search_text|Search recursively for text in remote directory / Grep files over SFTP/FTP protocol]]; | + | |
| - | ··* [[library_example_recursive_download_custom_error_handling|Recursively download directory tree with custom error handling]]; | + | |
| - | * [[library_example_find_duplicate_files|Find duplicate files in SFTP/FTP server]]; | + | |
| - | * [[script_custom_listing_format_csv|Custom directory listing format (CSV)]]. | + | |