如何在VB中获取MP3、WMA、MP3Pro等文件的歌曲名、艺术家等信息?
1个回答
展开全部
Private Sub Command1_Click()
Dim arrFile(), oFile, oDir, oShell
Dim i, sTmp, sPrint
ReDim arrFile(1)
arrFile(0) = "明天,你好.MP3" '请根据实际修改
arrFile(1) = "E:\mp3\"'请根据实际修改
Set oShell = CreateObject("Shell.Application")
Set oDir = oShell.NameSpace(arrFile(1))
Set oFile = oDir.ParseName(arrFile(0))
For i = 0 To 100
sTmp = oDir.GetDetailsOf(, i) + vbTab
If sTmp = vbTab Then Exit For
sPrint = sPrint + vbCrLf + sTmp + vbTab + _
oDir.GetDetailsOf(oFile, i)
Next
MsgBox sPrint
Set oFile = Nothing
Set oDir = Nothing
Set oShell = Nothing
End Sub
Dim arrFile(), oFile, oDir, oShell
Dim i, sTmp, sPrint
ReDim arrFile(1)
arrFile(0) = "明天,你好.MP3" '请根据实际修改
arrFile(1) = "E:\mp3\"'请根据实际修改
Set oShell = CreateObject("Shell.Application")
Set oDir = oShell.NameSpace(arrFile(1))
Set oFile = oDir.ParseName(arrFile(0))
For i = 0 To 100
sTmp = oDir.GetDetailsOf(, i) + vbTab
If sTmp = vbTab Then Exit For
sPrint = sPrint + vbCrLf + sTmp + vbTab + _
oDir.GetDetailsOf(oFile, i)
Next
MsgBox sPrint
Set oFile = Nothing
Set oDir = Nothing
Set oShell = Nothing
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询