c# - How can I read file properties/metadata? -
I should look at the system file properties as shown in the image below, especially title and Copyright Properties How can I do this? Normally you Then check the You can find all the properties listed in the documentation on MSDN. System.Diagnostics ,
file description and
LegalCopyright properties. Although the case is different for images, you need to explicitly remove bitmap metadata. Think, using
(stream fs = file. Open ("path \ to \ file", FileMode.Open, FileAccess.ReadWrite)) {bitmapcodecoder decoder = bitmapdicoder. Composition (FS, Bitmapcreate Option None, BitmapUp Default); Bitmapframe frame = decoder Frame [0]; // First frame with metadata bitmap metadata metadata = frame. Metadata as bitmap metadata; Check if (metadata! = Null) // // metadata Title, metadata Copyright) fs.Close (); }
Comments
Post a Comment