|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Change file commentsI've been asked to develop an application which, on some certain stage
during its execution, must take some text files on disk and change their "comments" property, which is easily accessed from windows explorer, just by clicking properties and writing them down, so I assume there must be some framework or Win32 API function or whatever to accomplish that. I'm aware of the FileVersionInfo class, but help states only executable files have version info, and that text files don't, so I guess there must be some other way. If any of you know about this, I'd be most grateful, since I need this very urgently. Thanks. > during its execution, must take some text files on disk and change their Comments on a plain-text (.txt) file? That would be a news for me... at > "comments" property, which is easily accessed from windows explorer, just > by least for non-Vista OS! -- Happy Hacking, Gaurav Vaish | www.mastergaurav.com www.edujinionline.com http://eduzine.edujinionline.com ----------------------------------------- "Gaurav Vaish (www.EdujiniOnline.com)"
<gaurav.vaish.nospam@nospam.gmail.com> escribió en el mensaje Show quote news:urHts$I7GHA.3760@TK2MSFTNGP02.phx.gbl... Just get any .txt file you have on disk, right click on it and then on >> during its execution, must take some text files on disk and change their >> "comments" property, which is easily accessed from windows explorer, just >> by > > Comments on a plain-text (.txt) file? That would be a news for me... at > least for non-Vista OS! > > > > -- > Happy Hacking, > Gaurav Vaish | www.mastergaurav.com > www.edujinionline.com > http://eduzine.edujinionline.com > ----------------------------------------- > > properties, and you'll find with I'm talking about. I think it's the "Summary" tab (don't lnow the exact name, since I use Windows in Spanish). There, you have some metadata, like comments, author, title, and so on. That's the info I was talking about. Anyway, I got the solution. Look for the reply I've just posted under the other guy who replied "jman" <asaasiw***@hotmail.com> wrote in message I believe that FileVersionInfo is looking at the executable file itself, news:%23e2i3aI7GHA.2384@TK2MSFTNGP04.phx.gbl... > I've been asked to develop an application which, on some certain stage > during its execution, must take some text files on disk and change their > "comments" property [...] > > I'm aware of the FileVersionInfo class, but help states only executable > files have version info, and that text files don't, so I guess there must > be some other way. which contains in its header the information returned by the FileVersionInfo class. So you're right, this isn't what you want. For the "Summary" information you're trying to retrieve, as far as I know there's no .NET support for it (which seems odd, so I might have missed something). You can probably use interop to get at it easily though, as it's a COM/OLE thing: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/stg/stg/the_summary_information_property_set.asp Pete
Show quote
"Peter Duniho" <NpOeStPe***@NnOwSlPiAnMk.com> escribió en el mensaje Thanks to Google Groups, I got the answer yesterday. It's quite tricky and news:12innrmkf1hvp18@corp.supernews.com... > "jman" <asaasiw***@hotmail.com> wrote in message > news:%23e2i3aI7GHA.2384@TK2MSFTNGP04.phx.gbl... >> I've been asked to develop an application which, on some certain stage >> during its execution, must take some text files on disk and change their >> "comments" property [...] >> >> I'm aware of the FileVersionInfo class, but help states only executable >> files have version info, and that text files don't, so I guess there must >> be some other way. > > I believe that FileVersionInfo is looking at the executable file itself, > which contains in its header the information returned by the > FileVersionInfo class. So you're right, this isn't what you want. > > For the "Summary" information you're trying to retrieve, as far as I know > there's no .NET support for it (which seems odd, so I might have missed > something). You can probably use interop to get at it easily though, as > it's a COM/OLE thing: > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/stg/stg/the_summary_information_property_set.asp > > Pete > you must rely on com interfaces, but it works like a charm (but a bit slow) The info is here: http://groups.google.es/group/microsoft.public.win2000.developer/browse_thread/thread/19430c8069527483/99a5dd5c80c084b5?lnk=st&q=c%23+file+comments&rnum=1#99a5dd5c80c084b5 |
|||||||||||||||||||||||