Results 1 to 22 of 22

Thread: bit more help please Access Denied?? "FINALLY RESOLVED" THANKS ALL!!

Threaded View

  1. #11
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: bit more help please Access Denied??

    Rob,


    here is the code for you to create both the mp3.txt if you need it and audiolist.xml from within vb, no batch file required, the way it is set up at the moment it creates both file in the folder where the mp3s are located, but his is esay to change if you keep you audiolist elsewhere

    VB Code:
    1. Declare Sub Sleep Lib "kernel32.dll" ( _
    2.      ByVal dwMilliseconds As Long)
    goes at the top under Option Expicit

    VB Code:
    1. Private Sub writexml()
    2.  
    3.     Dim f1 As Integer, songpath As String, mp3path As String, f2 As Integer, i As Integer
    4.    
    5.    
    6.     mp3path = "C:\Documents and Settings\User1\My Documents\My Music\MP3\The Greatest Oldies (vol 1)\"
    7.    
    8.      f2 = FreeFile
    9.     Open mp3path & "mp3.txt" For Output As #f2       ' if you don't need mp3.txt take out
    10.      f1 = FreeFile
    11.      
    12.     Open mp3path & "audiolist.xml" For Output As #f1
    13.     Print #f1, "<?xml version=""1.0""?>"
    14.     Print #f1, "<songs>"
    15.     songname = Dir(mp3path & "\*.mp3")   ' get first track
    16.     i = 1
    17.     While Not Len(songname) = 0
    18.         songpath = "<song path=""" & mp3path & songname & """ title=""" & songname & """/> "
    19.         Print #f1, songpath
    20.         Print #f2, songname                  ' for mp3.txt
    21.         Sleep 100                                ' slight pause, needed
    22.         songname = Dir                         ' get next track
    23.    
    24.     Wend
    25.     Print #f1, "</songs>"
    26.  
    27.  
    28. Close
    29. End Sub
    you can put this code into a button click or cal it from a button click

    hope this helps to you to progress in VB

    rgds p.
    Last edited by westconn1; Jan 15th, 2005 at 08:45 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width