Winform Tip#10: Getting File Properties

Instantiate a FileInfo object with the full path as constructor arg. Then simply call FileInfo.Extension and you will get just the extension of the file.

 

FileInfo finfo = new FileInfo(strFileName);
Console.WriteLine(finfo.Extension);

Similarly, you can get more properties

Continue reading » · Rating: · Written on: 07-25-09 · No Comments »

Ten Traps in C# for C++ Programmers

Though this boils down to basics, these are most often missed out in projects and hence are performance issues.

 

http://ondotnet.com/pub/a/oreilly/dotnet/news/programmingCsharp_0801.html

 

The author has very beautifully touched on topics like:

  1. Destructors
  2. Dispose and Finalize
  3. Value & Reference Types
  4. Boxing
  5. Structures
  6. Virtual methods
  7. and many more…

A must read for newbies…

 

Continue reading » · Rating: · Written on: 07-24-09 · No Comments »