Session.CombinePaths Method

Combines strings into a remote/*nix path.

Syntax

C#
public string CombinePaths(string path1, string path2)
VB.NET
Public Function CombinePaths(ByVal path1 As String, ByVal 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

 
  library_session_combinepaths.txt · Last modified: by martin
 

Search Documentation

This page

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

Associations

Site design by Black Gate