Change File Attributes ???

G

Guest

I have a file, when i right click on the file i can get a properties page, in the properties page i have a summary tab, i want to programmatically change the values in the advanced summary tab, is this possible in vb.net?

Basically i have 1000's of *.mp3 files, i need to change the artist and album in the advanced summary page of the file properties using vb.net or C#. Any Ideas?

Thanks Eric.
 
C

Cor

Hi Eric,

Bart has given this once to the newsgroups, I do not know if it works.

Cor

\\\By Bart Verdonck
(comments where in dutch, translated a little bit by Cor)
Private Sub MP3InfoOphalen()
Try
' Open a FileStream openen, binded to the file
Dim strMP3 As New IO.FileStream(Me.BestandsNaam, _
IO.FileMode.Open, IO.FileAccess.Read)
'Use a BinaryReader to read binary the characters from the FileStream
Dim binReader As New IO.BinaryReader(strMP3)
' When they are present is it in the MP3-informatie 127 bytes before the
end of the file
binReader.BaseStream.Seek(-128, IO.SeekOrigin.End)
' Only if the first 3 bytes on that position makes the word TAG, than
'contains the file real MP3-information, which we can get from it
If binReader.ReadChars(3) = "TAG" Then
msTitel = binReader.ReadChars(30)
' We read 30 characters for the tittle
msArtiest = binReader.ReadChars(30)
' We read 30 characters for the artist
msAlbum = binReader.ReadChars(30)
' We read 30 characters for the album
msJaar = binReader.ReadChars(4)
' We read 4 characters for the year
msCommentaar = binReader.ReadChars(30)
' We read 30 characters for comment
Else
' No real MP3-bestand: clean the fields
msTitel = ""
msArtiest = ""
msAlbum = ""
msJaar = ""
msCommentaar = ""
End If
' Close the BinaryReader and FileStream
binReader.Close()
strMP3.Close()
Catch ex As IO.IOException
msTitel = ""
msArtiest = ""
msAlbum = ""
msJaar = ""
msCommentaar = ""
End Try
End Sub
 
G

Guest

Thanks,
This works great for reading the data from the MP3 file, any idea how to write / change the data?
 
L

Lloyd Sheen

There is a dot net assembly to do this. I have the files but cannot
remember the URL that got them. Check in MSDN since I think that is where
the article on using the dll(s) are and where to get the dll.

Lloyd Sheen

Eric said:
Thanks,
This works great for reading the data from the MP3 file, any idea how to
write / change the data?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top