G
Guest
I want to make sure that a filename is an "absolute path" (ie. has a drive
spec. and root, or else is a UNC path) if it isn't already one.
Path.GetFullPath seems to do the trick, except there is one thing in the MSDN
documentation that makes me nervous.
MSDN says that GetFullPath will throw NotSupportedException if its argument
contains a ":". If GetFullPath behaved this way I would not be able to use it
because, for example, Path.GetFullPath(@"D:\file.ext") would throw an
excpetion. Instead, I find that it does not throw an exception, but returns
"D:\file.ext" as I would like.
Does anyone know which behavior is correct? Is Path.GetFullPath supposed to
throw an exception if its argument contains a ":"? Or, is it that a ":" in
the pathname now supported in .NET 1.1 and the documentation is out of date?
Thanks in advance for any help,
Mark Urish
spec. and root, or else is a UNC path) if it isn't already one.
Path.GetFullPath seems to do the trick, except there is one thing in the MSDN
documentation that makes me nervous.
MSDN says that GetFullPath will throw NotSupportedException if its argument
contains a ":". If GetFullPath behaved this way I would not be able to use it
because, for example, Path.GetFullPath(@"D:\file.ext") would throw an
excpetion. Instead, I find that it does not throw an exception, but returns
"D:\file.ext" as I would like.
Does anyone know which behavior is correct? Is Path.GetFullPath supposed to
throw an exception if its argument contains a ":"? Or, is it that a ":" in
the pathname now supported in .NET 1.1 and the documentation is out of date?
Thanks in advance for any help,
Mark Urish