帮忙从C#.net翻译到VB.net
来源:百度知道 编辑:UC知道 时间:2024/07/01 07:49:19
Public Structure Mp3Info
Public identify 'TAG,三个字节 As String
Public Title '歌曲名,30个字节 As String
Public Artist '歌手名,30个字节 As String
Public Album '所属唱片,30个字节 As String
Public Year '年,4个字符 As String
Public Comment '注释,28个字节 As String
Public reserved1 '保留位,一个字节 As Char
Public reserved2 '保留位,一个字节 As Char
Public reserved3 '保留位,一个字节 As Char
End Structure
所以,我们只要把MP3文件的最后128个字节分段读出来并保存到该结构里就可以了。函数定义如下:
'/
'/ 获取MP3文件最后128个字节
'/
'/ 文件名
'/ 返回字节数组
private Byte() getLast128(String FileName)
{
Dim fs As FileStream = New FileStream(FileName,FileMode.Open,FileAccess.Read)
Dim stream As Stream = fs
stream.Seek(-128,SeekOrigin.End)
const Integer seekPos = 128