views:

133

answers:

1

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)?

+9  A: 

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.

Anton Gogolev
+1 One thing to note is that Path.GetFullPath() will return the full path whether or not the file exists. This can be useful, but it's something to watch out for in some cases.
Aaron
I wish I could up vote your answer more than once. This has plagued our team for years!
Bernhard Hofmann