Bernhard Hofmann
Bernhard Hofmann

Reputation: 10411

How do I convert a relative path to a fully qualified path in C# / .NET?

Let's say I have a file name defined as "..............\bin\prices.xls", is there a simple way to convert that to a fully qualified path (one that includes the Drive letter, colon and all folders to the file)?

Upvotes: 7

Views: 2621

Answers (1)

Anton Gogolev
Anton Gogolev

Reputation: 115867

Try Path.GetFullPath():

Returns the absolute path for the specified path string.

The absolute path includes all information required to locate a file or directory on a system.

Upvotes: 15

Related Questions