Von http://www.iamsmo.com/site/aspmp3lister/aspmp3lister.htm
<%@ Language=VBScript %> <% Option Explicit %> <% '******************************************** '* ASP MP3 Lister By Smo * '* (c) 2001 By Tim Smulders * '* Version 1 * '* http://www.iamsmo.com * '******************************************** 'Ignore this line below. Dim strPhysicalAddressOfMP3Folder, strMP3IsALink, strVirtualAddressOfMP3Folder, strTableBackGroundColor, strTableBorderColor, strCreateAspPage, strPhysicalAddressOfFolderWithWritePermission, strAspPageName, arrGenre, objFSO, objMP3Directory, objMP3, strAspPage, MP3, strComment, strTag, intGenre, objAspPage 'Between the quotes in the line below enter the 'physical address of your mp3 folder. strPhysicalAddressOfMP3Folder = "C:\Physical\Address\Of\MP3Folder" 'If you want the MP3 filename to be a link so users 'can download the file leave Yes between the quotes 'in the line below. If you do not want the filename 'to be a download link enter No between the quotes. strMP3IsALink = "Yes" 'If strMP3IsALink above is set to Yes you must enter 'the virtual address of your mp3 folder between the 'quotes in the line below. strVirtualAddressOfMP3Folder = "http://www.mywebsite.com/Virtual/Address/Of/MP3Folder" 'Enter the hexadecimal color for the table background. strTableBackGroundColor = "#CCCCCC" 'Enter the hexadecimal color for the table border. strTableBorderColor = "#000000" 'If you want to create an asp file from the list 'leave Yes between the quotes in the line below. 'You can use the created asp file as an include file. 'If you do not want to create an asp file from the 'list enter No between the quotes. strCreateAspPage = "Yes" 'If strCreateAspPage above is set to Yes you must enter 'the physical address of the folder where you want the asp 'file to be created between the quotes in the line below. 'This folder must have write permission. strPhysicalAddressOfFolderWithWritePermission = "C:\Physical\Address\Of\FolderWithWritePermission" 'If strCreateAspPage above is set to Yes you must enter 'a name for the asp file between the quotes in the line 'below. Its best to move the created asp file to a 'different directory before linking to it so your users 'do not know the location of your writable directory. strAspPageName = "mymp3list.asp" 'You can ignore everything else below this line. arrGenre = Split("Blues,Classic Rock,Country,Dance,Disco,Funk,Grunge,Hip-Hop,Jazz,Metal,New Age,Oldies,Other,Pop,R&B,Rap,Reggae,Rock,Techno,Industrial,Alternative,S ka,Death Metal,Pranks,Soundtrack,Euro-Techno,Ambient,Trip-Hop,Vocal,Jazz+Funk,Fus ion,Trance,Classical,Instrumental,Acid,House,Game,Sound Clip,Gospel,Noise,Altern Rock,Bass,Soul,Punk,Space,Meditative,Instrumental Pop,Instrumental Rock,Ethnic,Gothic,Darkwave,Techno-Industrial,Electronic,Pop-Folk,Euroda nce,Dream,Southern Rock,Comedy,Cult,Gangsta,Top 40,Christian Rap,Pop/Funk,Jungle,Native American,Cabaret,New Wave,Psychadelic,Rave,Showtunes,Trailer,Lo-Fi,Tribal,Acid Punk,Acid Jazz,Polka,Retro,Musical,Rock & Roll,Hard Rock,Folk,Folk/Rock,National Folk,Swing,Bebob,Latin,Revival,Celtic,Bluegrass,Avantgarde,Gothic Rock,Progressive Rock,Psychedelic Rock,Symphonic Rock,Slow Rock,Big Band,Chorus,Easy Listening,Acoustic,Humour,Speech,Chanson,Opera,Chamber Music,Sonata,Symphony,Booty Bass,Primus,Porn Groove,Satire,Slow Jam,Club,Tango,Samba,Folklore", ",") Response.Write "<html><head><title>ASP MP3 Lister</title><meta http-equiv=""Content-Type"" content=""text/html; charset=iso-8859-1""></head><body bgcolor=""#FFFFFF"">" Response.Write "<table width=""100%"" border=""0""><tr valign=""top"" align=""left""><td>ASP MP3 Lister Version beta 1 © <a href=""http://www.iamsmo.com"">I Am Smo</a></td></tr></table><br><form name=""CreateMP3List"" method=""post"" action=""aspmp3lister_v1.asp?aspmp3listerstep=createmp3list""><table width=""100%"" border=""0""><tr valign=""top"" align=""left""><td><input type=""submit"" name=""Submit"" value=""Create MP3 List""></td></tr></table><br>" If Request.QueryString("aspmp3listerstep") = "createmp3list" Then Set objFSO = CreateObject("Scripting.FileSystemObject") Set objMP3Directory = objFSO.GetFolder(strPhysicalAddressOfMP3Folder) Set objMP3 = Server.CreateObject("ADODB.Stream") objMP3.Type = 1 strAspPage = "<table border=""1"" bgcolor=""" & strTableBackGroundColor & """ bordercolor=""" & strTableBorderColor & """ cellspacing=""0"" cellpadding=""0""><tr align=""center"" valign=""middle""><td> File Size </td><td> File Name </td><td> Title </td><td> &nb sp;Artist </td><td> Album </td><td>&nbs p; Year </td><td> Comment </td><td > Track </td><td> Genre </td ><td> Tag </td></tr>" For Each MP3 in objMP3Directory.Files strAspPage = strAspPage & "<tr align=""center"" valign=""middle""><td> " & Round((MP3.Size * .000001), 2) & " meg </td>" If strMP3IsALink = "Yes" Then strAspPage = strAspPage & "<td> <a href=""" & strVirtualAddressOfMP3Folder & "/" & MP3.Name & """>" & MP3.Name & "</a> </td>" Else strAspPage = strAspPage & "<td> " & MP3.Name & " </td>" End If objMP3.Open objMP3.LoadFromFile MP3.Path objMP3.Position = objMP3.Size - 128 If UCase(ConvertTheBinary(objMP3.Read(3))) = "TAG" Then strAspPage = strAspPage & "<td> " & ConvertTheBinary(objMP3.Read(30)) & " </td>" strAspPage = strAspPage & "<td> " & ConvertTheBinary(objMP3.Read(30)) & " </td>" strAspPage = strAspPage & "<td> " & ConvertTheBinary(objMP3.Read(30)) & " </td>" strAspPage = strAspPage & "<td> " & ConvertTheBinary(objMP3.Read(4)) & " </td>" strComment = objMP3.Read(30) If AscB(MidB(strComment, 29, 1)) = 0 AND AscB(MidB(strComment, 30, 1)) > 0 AND AscB(MidB(strComment, 30, 1)) < 256 Then strTag = "ID3v1.1" strAspPage = strAspPage & "<td> " & ConvertTheBinary(LeftB(strComment, 28)) & " </td>" strAspPage = strAspPage & "<td> " & AscB(MidB(strComment, 30, 1)) & " </td>" Else strTag = "ID3v1" strAspPage = strAspPage & "<td> " & ConvertTheBinary(strComment) & " </td>" strAspPage = strAspPage & "<td> </td>" End If intGenre = AscB(objMP3.Read(1)) If intGenre <= 114 AND intGenre >= 0 Then strAspPage = strAspPage & "<td> " & arrGenre(intGenre) & " </td>" Else strAspPage = strAspPage & "<td> </td>" End If strAspPage = strAspPage & "<td> " & strTag & " </td></tr>" Else strAspPage = strAspPage & "<td colspan=""8""> NO ID3v1 or ID3v1.1 TAG found for this file </td></tr>" End If objMP3.Close Next strAspPage = strAspPage & "</table>" Set objMP3 = Nothing Set objMP3Directory = Nothing Set objFSO = Nothing End If Response.Write strAspPage & "</body></html>" If strCreateAspPage = "Yes" Then Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objAspPage = objFSO.CreateTextFile(strPhysicalAddressOfFolderWithWritePermission & "\" & strAspPageName) objAspPage.WriteLine(strAspPage) objAspPage.Close Set objAspPage = Nothing Set objFSO = Nothing End If Function ConvertTheBinary(thebytes) Dim x For x = 1 to LenB(thebytes) If AscB(MidB(thebytes, x, 1)) <> 0 Then ConvertTheBinary = ConvertTheBinary & Chr(AscB(MidB(thebytes, x, 1))) End If Next End function %> _______________________________________________ Codeschnipsel mailing list [EMAIL PROTECTED] http://www.glengamoi.com/mailman/listinfo/codeschnipsel
