This is an old revision of the document!
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
, 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.
Advertisement
The URL can also include advanced settings. This feature is available only in the latest beta release.
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
or !S
. This allows easy implementation of WinSCP extensions using e.g. PowerShell scripts that make use of WinSCP .NET assembly.