Condividi tramite


Path.Combine Method (array<String[])

Microsoft Silverlight will reach end of support after October 2021. Learn more.

When it is called by trusted applications, combines an array of strings into a path.

Namespace:  System.IO
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Shared Function Combine ( _
    ParamArray paths As String() _
) As String
public static string Combine(
    params string[] paths
)

Parameters

  • paths
    Type: array<System.String[]
    An array of parts of the path.

Return Value

Type: System.String
A string that contains the combined paths.

Exceptions

Exception Condition
ArgumentException

One of the strings in the array contains one or more of the invalid characters defined in GetInvalidPathChars.

ArgumentNullException

One of the strings in the array is nulla null reference (Nothing in Visual Basic).

Remarks

paths should be an array of the parts of the path to combine. If the one of the subsequent paths is an absolute path, then the combine operation resets starting with that absolute path, discarding all previous combined paths.

Zero-length strings are omitted from the combined path.

Version Information

Silverlight

Supported in: 5, 4

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.