| Home | Biography | Speaking | Articles | Books | Music |
FileInfo Doesn’t Override EqualsSo if you write code like this:
FileInfo f1 = new FileInfo(@"C:\File1.txt");
FileInfo f2 = new FileInfo(@"C:\File1.txt");
bool areEqual = f1 == f2;
areEqual will be false. At least that’s what I saw today.
Mrph.
Oh well, this “fixes” it (at least it makes sense to me!):
bool areEqual = f1.FullName == f2.FullName;
Published: 02.25.2008 04:02:27 PM CST