comparing path

  • Thread starter Thread starter Lloyd Dupont
  • Start date Start date
L

Lloyd Dupont

is there an easy way to compare path to se if they are equals?

example:
let's assume current dir is:
C:\myapp\bin

these 4 path are equals although they are displayed as different string
...\resources\one.bmp
c:\myapp\resources\one.bmp
C:\myapp\resources\one.bmp
c:\myapp\bin\..\resources\one.bmp

is there anyway simple way to know that?
I didn't find any method kind of: Path.CanonicalPath in the path class.
any suggestion?
 
ok, I found something almost good.
Path.GetFullPath()

return unique, identical path string in almost all case!
it just fail to see that 'c:' and 'C:' (lower case / upper case) are the
same disk....
well not too bad, just a little work around to write
 
Back
Top