comparing path

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

Lloyd Dupont

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top