SessionOptions.ParseUrl Method
Parses session URL into its components.
Advertisement
Syntax
public void ParseUrl(string url)
Public Sub ParseUrl(url As String)
Parameters
Name | Description |
---|---|
string url | Session URL to parse. |
Exceptions
Exception | Condition |
---|---|
ArgumentException | The URL given does not have correct format. |
Remarks
Parses the given session URL and stores the results into Protocol
, HostName
, UserName
, Password
(SecurePassword
), PortNumber
, SshHostKeyFingerprint
, FtpSecure
, Secure
and RootPath
properties.
Resets properties not specified in the URL to their default values. Always resets GiveUpSecurityAndAcceptAnySshHostKey
, TlsHostCertificateFingerprint
, and GiveUpSecurityAndAcceptAnyTlsHostCertificate
to their default values.
Advertisement
The URL can also include advanced settings.
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 patterns !E
(preferred) or !S
. This allows an easy implementation of WinSCP extensions using e.g. PowerShell scripts that make use of WinSCP .NET assembly.