SessionOptions.ParseUrl Method

Parses session URL into its components.


public void ParseUrl(string url)
Public Sub ParseUrl(url As String)


Name Description
string url Session URL to parse.


Exception Condition
ArgumentException The URL given does not have correct format.


Parses the given session URL and stores the results into Protocol, HostName, UserName, Password (SecurePassword), PortNumber, SshHostKeyFingerprint, FtpSecure, WebdavSecure and WebdavRoot properties.

Resets properties not specified in the URL to their default values. Always resets GiveUpSecurityAndAcceptAnySshHostKey, TlsHostCertificateFingerprint, and GiveUpSecurityAndAcceptAnyTlsHostCertificate to their default values.

Note that the method parser is more strict, than a parser used for URLs with scripting command open or command-line.

You can use the method to accept session URL provided by a custom command pattern !S. This allows easy implementation of WinSCP extensions using e.g. PowerShell scripts that make use of WinSCP .NET assembly.