Rohith,
Is there a way to add Comments (right click on a file, in the summary tab
this information will be present) to a file in C#.
Yes there is, but I'm afraid the .NET Framework doesn't support this
directly. And, unfortunately the process is somewhat more difficult than you
might think at first.
Before we start, you need to understand something about so-called NTFS
Alternative Data Streams (ADSs). These streams allow you to associate
"hidden" data with any file, and this is what Windows Explorer does when you
associate summary information with the file, i.e. go to file properties
dialog box and its Summary tab on Windows 2000/XP/2003. If all this sounds
very new to you, I suggest reading for example this Dino Esposito's
introduction:
http://msdn.microsoft.com/library/de...html/ntfs5.asp
Now, these alternate streams are somewhat a double-edged sword as they can
be used to store both useful and not-so-useful data. See for instance here:
http://www.relsoft.net/datastreams.html
Setting the potential security issue aside, you need to be able to read and
write a special stream to your file to be able to associate summary
information with it. To do it, you would need to use some Windows API
functions. I couldn't find C# examples with quick surfing, but here's a
Delphi one:
http://www.delphipages.com/news/detaildocs.cfm?ID=104
Here's also an interesting Windows Shell Extension from The Code Project:
http://www.codeproject.com/csharp/Cs...torArticle.asp
And, yet another article that you might find useful:
http://msdn.microsoft.com/msdnmag/issues/0300/w2kui/
Hope this gets you started!
--
Regards,
Mr. Jani Järvinen
C# MVP
Helsinki, Finland
ja***@removethis.dystopia.fi http://www.saunalahti.fi/janij/