Extended file attributes

GJackson

New member
Joined
Feb 16, 2005
Messages
2
Programming Experience
5-10
Hi,
I need to read a files extended attributes in VB .NET. I currently do this with WSH/VBS, but I need the same capability in VB .NET. In VBS I use the GetDetailsOf() method to get the "Dimension" atribute of a file. The 26, seen below, corresponds to the index of the "Dimension" file attribute or property. Is there a way to retrive extended file attributes in VB .NET?? Is so does someone have a sample?

'--- VB Script Snippit
Set zobjFolder = objShell.NameSpace(objFolder.Path)
if (Not zobjFolder Is Nothing) Then
dim zobjFolderItem
set zobjFolderItem = zobjFolder.ParseName(FName)
if (not zobjFolderItem Is Nothing) Then
dim zobjInfo
Dimensions = zobjFolder.GetDetailsOf(zobjFolderItem, 26)
end If
set zobjFolderItem = Nothing
end If

Thanks in advance!
 

TPM

Well-known member
Joined
Dec 7, 2004
Messages
623
Location
CA
Programming Experience
3-5
Use the system.IO.file. You'll find get creation time etc there.

TPM
 

MNeb

Member
Joined
Feb 22, 2005
Messages
21
Programming Experience
1-3
What do you mean by "Dimension"? Is that file size?

Like TPM said, look at system.IO.file or .fileinfo
 

GJackson

New member
Joined
Feb 16, 2005
Messages
2
Programming Experience
5-10
The Dimension is a property/Attribute for ".tif" files.
The info I needed wasn't in file.IO
I had to set a reference to "Imports Shell32".
And use:
Dim sh As New ShellClass

Dim item As FolderItem

Dim dir32 As Folder

If UCase(ExtensionName) = "TIF" Then

PathName = UCase(Mid(fname, 1, InStrRev(fname, "\") - 1))

StrFileName = UCase(Mid(fname, InStrRev(fname, "\") + 1))

'--- Creating a Folder Object from Folder that inculdes the File

dir32 = sh.NameSpace(Path.GetDirectoryName(fname))

'--- Creating a new FolderItem from Folder that includes the File

item = dir32.ParseName(Path.GetFileName(fname))

Try

Dimensions = dir32.GetDetailsOf(item, 26)

Catch ex As Exception

Console.WriteLine(ex.Message)

End Try

End If
 
Top Bottom