Session.CombinePaths Method

Combines strings into a remote/*nix path.

This method is deprecated since the current beta version. Use static method RemotePath.CombinePaths instead.

Syntax

C#
public string CombinePaths(string path1, string path2)
VB.NET
Public Function CombinePaths(path1 As String, path2 As String) As String

Parameters

Name Description
string path1 The first path to combine.
string path2 The second path to combine.

Return Value

The combined paths.

Exceptions

Exception Condition
ArgumentNullException Some of the arguments is null.

Remarks

Concatenates path1 with path2, interleaving them with a slash (/), unless the path1 already ends with a slash.

If one of the paths in empty, returns the other path.

If the path2 is an absolute path (starts with a slash), returns path2.

The method is an equivalent of the standard Path.Combine method for remote/*nix paths.

Examples

Real-Life Example

Last modified: by martin