Click or drag to resize
PathCombine Method (String, String)
Combines two strings into a path.

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static string Combine(
	string path1,
	string path2
)

Parameters

path1
Type: SystemString
The first path to combine.
path2
Type: SystemString
The second path to combine.

Return Value

Type: String
The combined paths. If one of the specified paths is a zero-length string, this method returns the other path. If path2 contains an absolute path, this method returns path2.
Exceptions
ExceptionCondition
ArgumentExceptionpath1 or path2 contains one or more of the invalid characters defined in GetInvalidPathChars.
ArgumentNullExceptionpath1 or path2 is null.
See Also