Windows Dev Center

Path.Combine Method (String[])

Combines an array of strings into a path.

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

public static string Combine(
	params string[] paths
)

Parameters

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

Return Value

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

ExceptionCondition
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 null.

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.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2015 Microsoft