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!
 
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
 
Back
Top