- Private Function createplaylist(ByVal srcPl As String, ByVal destDr As String, ByVal destPl As String)
- Dim fso As New Scripting.FileSystemObject
- Dim fxo As Scripting.TextStream = fso.OpenTextFile(srcPl, Scripting.IOMode.ForReading, False, Scripting.Tristate.TristateUseDefault)
- Dim fxo2 As Scripting.TextStream = fso.OpenTextFile(destPl, Scripting.IOMode.ForWriting, True, Scripting.Tristate.TristateUseDefault)
- Dim s, drv As String
- drv = srcPl(0)
- While (1)
- Try
- s = fxo.ReadLine()
- If s(0) = "#" Then
- fxo2.WriteLine(s)
- Continue While
- Else
- If s(1) <> ":" Then
- s = drv + ":\" + s
- End If
- Try
- fso.CopyFile(s, destdr + "\" + fso.GetFileName(s))
- fxo2.WriteLine(destdr + "\" + fso.GetFileName(s))
- Catch ex As Exception
- End Try
- End If
- Catch ex As Exception
- GoTo xxx
- End Try
- End While
- xxx:
- Return Nothing
- End Function
Download full working example code (*.vbproj)
Be sure to include scrrun.dll (which can be found in c:\windows\system32 directory) in your project.
No comments:
Post a Comment