|
-
May 2nd, 2007, 02:35 AM
#1
Thread Starter
Hyperactive Member
[2005] Get extended file info
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?
Prefix has no suffix, but suffix has a prefix.
-
May 4th, 2007, 08:23 PM
#2
Re: [2005] Get extended file info
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.
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);
...
I am looking into seeing how to get the assembly info and other things like that.
-
May 4th, 2007, 08:35 PM
#3
Re: [2005] Get extended file info
Turns out File Version information is pretty easy:
Code:
MessageBox.Show(FileVersionInfo.GetVersionInfo("C:\Program Files\Adobe\Acrobat 7.0\Reader\Acrord32.exe").FileVersion)
-
May 5th, 2007, 01:21 AM
#4
Thread Starter
Hyperactive Member
Re: [2005] Get extended file info
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?
Prefix has no suffix, but suffix has a prefix.
-
May 5th, 2007, 07:31 AM
#5
Re: [2005] Get extended file info
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
-
May 5th, 2007, 02:52 PM
#6
Thread Starter
Hyperactive Member
Re: [2005] Get extended file info
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.
Prefix has no suffix, but suffix has a prefix.
-
Oct 22nd, 2008, 01:49 AM
#7
Lively Member
Re: [2005] Get extended file info
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
---------------------------------------------------
noob coder
---------------------------------------------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|