Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to go about file properties

Tags:

c#

Whats the best way to read/write file properties (like author, description, etc) in C#? I can use dsofile.dll to accomplish this but I wonder if this is the right way to go. (being unmanaged code?)

Any ideas?

like image 709
Ralf de Kleine Avatar asked Sep 05 '09 19:09

Ralf de Kleine


People also ask

How do I navigate to file Properties?

Click the File tab. Click Info to view the document properties. To add or change properties, hover your pointer over the property you want to update and enter the information. Note that for some metadata, such as Author, you'll have to right-click on the property and choose Remove or Edit.

How do I find folder Properties?

Just as in Windows Explorer, you can view the properties of any file or folder by right-clicking the file, then clicking Properties. Local pane information: Type: Kind of item (e.g., HTML document, File Folder)

How do I open Properties without right clicking?

In File Explorer, hold down the ALT key and simply double click the file or folder. The Properties window will open directly! You don't need to right click and select the Properties menu item. If you prefer exclusively using the keyboard, you can select the file and press Alt+Enter.


1 Answers

Microsoft explicitly recommends dsofile.dll for use with .NET. Not sure why you think this would be inappropriate - it ultimately uses the very code that other structured file readers also use. Reimplementing this in managed code would be error-prone, and likely does more harm than good.

like image 176
Martin v. Löwis Avatar answered Oct 22 '22 20:10

Martin v. Löwis