I know about the FileInfo class. I want to access other info though. Such as the info on the summary tab of a file's property dialog. Also, the assembly version.
How is this done?
Printable View
I know about the FileInfo class. I want to access other info though. Such as the info on the summary tab of a file's property dialog. Also, the assembly version.
How is this done?
Just so you know I am trying to help you out with this. I did something similar for image files where I wanted to get the photo date (if it exists) and here is some code on how I did it in one of my C# programs.
I am looking into seeing how to get the assembly info and other things like that.Code:FileInfo[] sFiles;
DirectoryInfo dInfo = new System.IO.DirectoryInfo(sSource);
sFiles = dInfo.GetFiles("*.jpg");
int i = 0;
foreach (System.IO.FileInfo sFile in sFiles)
{
i++;
Image objImage = Image.FromFile(sFile.FullName);
System.Drawing.Imaging.PropertyItem objPropItem = objImage.GetPropertyItem(36867);
string sDateTime = System.Text.Encoding.ASCII.GetString(objPropItem.Value);
...
Turns out File Version information is pretty easy:
Code:MessageBox.Show(FileVersionInfo.GetVersionInfo("C:\Program Files\Adobe\Acrobat 7.0\Reader\Acrord32.exe").FileVersion)
I know about the File Version Info and thanks for the code on image properties. Is that the way to read EXIF data in a jpeg?
That C# code I posted does read the EXIF data, the getpropertyitem function is what reads it.
Here is a good example from VBAccelerator:
http://www.vbaccelerator.com/home/NE...es/article.asp
Ok, thanks for the link. I converted some of it to try it out in vb.
I am still trying to figure out how to get the info on the summary tab of a file's property dialog. I try searching Google but so many erroneous pages come up it's frustrating.
I have a sample code of what you may need.
as for the Summary, I forgot the propid of it.
vb Code:
Dim image1 As System.Drawing.Image Dim Title, Author, Keywords, Subject As String image1 = Drawing.Image.FromFile(picturePath) Dim allProperty() As System.Drawing.Imaging.PropertyItem = image1.PropertyItems For Each propTemp As System.Drawing.Imaging.PropertyItem In allProperty Select Case propTemp.Id Case 40091 'Title Title = System.Text.ASCIIEncoding.Unicode.GetString(propTemp.Value) Case 40092 'Comments Comments = System.Text.ASCIIEncoding.Unicode.GetString(propTemp.Value) Case 40093 'Author Author = System.Text.ASCIIEncoding.Unicode.GetString(propTemp.Value) Case 40094 'Keywords Keywords = System.Text.ASCIIEncoding.Unicode.GetString(propTemp.Value); Case 40095 'Subject subject = System.Text.ASCIIEncoding.Unicode.GetString(propTemp.Value) 'Response.Write(subject.ToString) 'Doing testing on this End Select Next