Export (0) Print
Expand All

Path.Combine Method (String, String, String)

When it is called by trusted applications, combines four strings into a path.

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

public static string Combine(
	string path1,
	string path2,
	string path3
)

Parameters

path1
Type: System.String
The first path to combine.
path2
Type: System.String
The second path to combine.
path3
Type: System.String
The third path to combine.

Return Value

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

ExceptionCondition
ArgumentException

path1, path2, path3, or path4 contains one or more of the invalid characters defined in GetInvalidPathChars.

ArgumentNullException

path1, path2, path3, or path4 is null.

path1 should be an absolute path.If one of the subsequent paths is also an absolute path, the combine operation discards all previously combined paths and resets to that absolute path.

Zero-length strings are omitted from the combined path.

Silverlight

Supported in: 5, 4

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

Community Additions

ADD
Show:
© 2014 Microsoft