Hey BR5 sind Musikdateien eines BMW Navis.
Wenn man diese wieder zurückwandeln möchte in MP3 geht das mit folgendem Excel Makro
lässt sich das ganze auch in vb.net realisieren?
Wenn man diese wieder zurückwandeln möchte in MP3 geht das mit folgendem Excel Makro
VB.NET-Quellcode
- Option Explicit
- Sub sBMW()
- Dim strQuellPath As String
- Dim files() As String
- Dim i As Long
- Dim lngMax As Long
- ReDim files(0)
- strQuellPath = Cells(1, 1)
- If strQuellPath = "" Then
- MsgBox "Bitte Stammverzeichnis, z.B. D:\BMW in A1 eintragen!"
- Exit Sub
- End If
- lngMax = Cells(Rows.Count, 1).End(xlUp).Row
- If lngMax > 1 Then
- Range(Cells(2, 1), Cells(lngMax, 2)).ClearContents
- Range(Cells(2, 1), Cells(lngMax, 2)).ClearFormats
- End If
- Call sGetFiles(strQuellPath, files())
- For i = 1 To UBound(files)
- Cells(i + 1, 1) = files(i)
- Next i
- ActiveSheet.Columns(1).AutoFit
- For i = 1 To UBound(files)
- Cells(i + 1, 1).Interior.Color = vbYellow
- Call sBMW2MP3(files(i))
- DoEvents
- Next i
- End Sub
- Sub sGetFiles(ByVal strPath As String, files() As String)
- Dim i As Long
- Dim strFileName As String
- Dim Directories() As String
- ReDim Directories(0)
- If Left(strPath, 1) <> "\" Then strPath = strPath & "\"
- strFileName = Dir(strPath, vbDirectory)
- Do While strFileName <> ""
- If GetAttr(strPath & strFileName) And vbDirectory Then
- If strFileName <> "." And strFileName <> ".." Then
- ReDim Preserve Directories(UBound(Directories) + 1)
- Directories(UBound(Directories)) = strPath & strFileName
- End If
- ElseIf InStr(UCase(strFileName), ".BR") > 0 Then
- ReDim Preserve files(UBound(files) + 1)
- files(UBound(files)) = strPath & strFileName
- End If
- strFileName = Dir
- Loop
- For i = 1 To UBound(Directories)
- Call sGetFiles(Directories(i), files())
- Next i
- End Sub
- Sub sBMW2MP3(strQ)
- Dim b As Byte
- Dim strZ As String
- Dim qKanal As Byte
- Dim zKanal As Byte
- qKanal = FreeFile()
- zKanal = FreeFile() + 1
- strZ = Mid(strQ, 1, Len(strQ) - 3)
- Select Case UCase(Right(strQ, 3))
- Case "BR3"
- strZ = strZ & "MP4"
- Case "BR4"
- strZ = strZ & "MP3"
- Case "BR5"
- strZ = strZ & "MP3"
- End Select
- If Dir(strZ) = "" Then
- Open strQ For Binary Lock Read As #qKanal Len = 32767
- Open strZ For Binary Lock Write As #zKanal Len = 32767
- Do
- Get #qKanal, , b
- b = 255 - b
- If EOF(qKanal) Then Exit Do
- Put #zKanal, , b
- Loop
- Close (qKanal)
- Close (zKanal)
- End If
- End Sub
lässt sich das ganze auch in vb.net realisieren?