'Place a command button and a text box on a form
'Remove Text1 from the Text property
'Set the Text box to multiline and scrollbars to both
'Place everything belwo into the click event of Command1
Dim fNum As Integer
Dim sTagIdent As String * 3
Dim sTitle As String * 30
Dim sArtist As String * 30
Dim sAlbum As String * 30
Dim sYear As String * 4
Dim sComment As String * 30
fNum = FreeFile
'Change this to your file path
Open "D:\Inetpub\Visual Basic\VectorTop10\1.mp3" For Binary As fNum
Seek #fNum, LOF(fNum) - 127
Get #fNum, , sTagIdent
If sTagIdent = "TAG" Then
Get #fNum, , sTitle
Get #fNum, , sArtist
Get #fNum, , sAlbum
Get #fNum, , sYear
Get #fNum, , sComment
End If
Close #fNum
'This will display the info into a text box, in this case named Text1.Text
Text1.Text = sTitle & "," & sArtist & "," & sAlbum & "," & sYear & "," & sComment
'This next one displays a msgbox with the ID info, jsy remove the comment tag
'MsgBox sTitle & "," & sArtist & "," & sAlbum & "," & sYear & "," & sComment
Greg Palmer
----------------------------------------
Any feed back is appreciated.
i have a question of similar type. its about image editing. i want to add just one alphabet (like "a" to the end of teh image file. but the problem is once i open it and add the "a" in notepad it says file corrupted. i found out that the problem was the editor(notepad - some bits or something like that). does ur code also work for images?
Right so let me get this right. You have an image file and you would like to add a letter into the image so that this letter is visible when you open the image in say MS Paint? Or that when you open the image in notepad you wish to add a letter to the end of all of the text you see on screen.
If it is the first then it will depend on if you want the letter to be added at exactly the same place each time.
If it is the second one then if you let us know why you need that doing we may be able to offer a better solution.
Greg Palmer
----------------------------------------
Any feed back is appreciated.
that letter is being added to the file to sort of corrupt it. i dont want to display the letter on the image. lets say the content of an image file is (in byte code):
@#$#@%#$^@@~!$^*
then i want to add a letter to it:
@#$#@%#$^@@~!$^*A
i dont want this letter to be displayed on the image but corrupt the file...
vbkris
The following code will add a letter to the end of the file. However it does not corrupt it so you can not see the image.
Private Sub Command1_Click()
Dim strInput As String
strInput = "a"
Open "c:\example.bmp" For Append As #1
Print #1, strInput
Close #1
End Sub
Greg Palmer
----------------------------------------
Any feed back is appreciated.
hi,
ur code seems simple. i do not have VB with me right now. i will test it, but i also want u to do something for me. reverse the process (ie remove the A from the file). now try opeening the file in paint. does it open?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.