This code works in development with IIS 7.5 for printing the extended attributes of a file, but does not find the attributes when running on the production server running IIS 8.
There are no errors and the attributes do appear in Windows Explorer.
Protected files as String = ""
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadDim videoPath As String = Server.MapPath("library/video/")
Dim videoPath As String = Server.MapPath("library/video/")
Dim videoFolder As New DirectoryInfo(videoPath)
Dim attrib As String
Dim titleDisplay As String
For Each fil As FileInfo In videoFolder.GetFiles("*.mp4")
titleDisplay = fil.Name().Replace(fil.Extension(), "")
attrib = getAttribute(fil, "Title")
If attrib.Length > 0 Then
titleDisplay &= "<br /><b>" & attrib & "</b>"
End If
attrib = getAttribute(fil, "Tags")
For Each att In attrib.Split(";")
titleDisplay &= "<br /><i>" & att & "</i>"
Next
files &= "<p>" & titleDisplay & "</p>"
Next
End Sub
Private Function getAttribute(ByVal file As FileInfo, ByVal attribute As String) As String
Dim value As String = ""
Dim shell As New Shell32.Shell()
Dim fld As Shell32.Folder = shell.NameSpace(Path.GetDirectoryName(file.FullName))
For Each s In fld.Items()
If fld.GetDetailsOf(s, 0).ToLower() = Path.GetFileName(file.FullName).ToLowerInvariant Then
For i As Integer = 0 To 34
If fld.GetDetailsOf(fld.Items, i) = attribute Then
value = fld.GetDetailsOf(s, i)
Exit For
End If
Next
Exit For
End If
Next
Return value
End Function