Skip to content

alexeveritt/CSharpPathResolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CSharpPathResolver

The CSharpPathResolver makes it easy to resolve relative file paths in c# using a single call. Simply pass in the base path and the relative path and the resolver will return the new target path. Below is an example of the types of path that are supported

If you are not sure of the format of the path that you are resolving then you would use the following command. This method will automatically detect the path style and resolve it correctly.

var resolver = new PathResolver();
var resolvedPath = resolver.ResolvePath("C:\Path1\Path2", "..\Path3");
// resolvedPath == "C:\Path1\Path3"

If you know the type of path you are resolving then you would call the specific resolve function.

PathResolver.ResolveUrlPath("http://bytechaser.com/path1/path2", "../../path3/path4")
// resolvedPath == "http://bytechaser.com/path3/path4"

About

C# Relative path resolver for file paths and urls

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages