226
Part II: Home Entertainment
QueryString("song"))
End Select
End Select
End If
%>
</body>
</html>
Exhibit B: display.asp
<%
Sub DisplayArtists()
Dim objFSO ' File system object
Dim objArtist ' Artist folder object
Dim strScriptName ' Name of parent script
Dim intAlbumCount ' Placeholder for number of album
subfolders for each artist
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
strScriptName = Request.ServerVariables("SCRIPT_NAME")
For Each objArtist in objFSO.GetFolder(MEDIA_LIBRARY_PATH).
Subfolders
intAlbumCount = objArtist.SubFolders.Count %>
<a href='<%= strScriptName %>?action=artist&artist=<%=
objArtist.Name %>'
<% If intAlbumCount = 1 Then %>
title='Click to see the <%= intAlbumCount %> album.'>
<% Else %>
title='Click to see all <%= intAlbumCount %> albums.'>
<% End If %>
<%= objArtist.Name %> (<%= intAlbumCount %>)<br>
</a>
<% Next
'Clean up
Set objFSO = Nothing
Set objArtist = Nothing
End Sub
Sub DisplayAlbums(strArtist)
Dim objFSO ' File system object
Dim objAlbum ' Artist folder object
Dim objSong ' Song file object
Dim strScriptName ' Name of parent script
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
strScriptName = Request.ServerVariables("SCRIPT_NAME")
%>
<h3>
<a href='<%= strScriptName %>?action=play&type=artist&artis
t=<%= strArtist %>'
Exhibit B
hhpg.indb 226
11/24/2004 1:56:12 PM

Get Home Hacking Projects for Geeks now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.