vb.netlrc校验 crc校验vb源代码( 二 )


Next
Lcr = Hex((sum And 255 Xor 255) + 1)
VB.NET 怎么同步显示lrc歌词??可以稍微改下vb.netlrc校验,预读两句歌词vb.netlrc校验的时间范围,时间大于第一句的起始点,小于第二句的起始点 , 那么显示第一句,
使用VB.NET制作带歌词显示的mp3播放器Public Class Form1
Dim soundname As String()
Dim i As Integer
Dim j, l As Boolean
Dim k As Integer
Dim filename As String '取歌曲vb.netlrc校验的名字
Dim path As String()
Dim s, m As Integer
Dim luj As String
Dim count As Integer '用来声明选择歌曲的数目
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
selectsound()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim g As Graphics
g = Graphics.FromHwnd(Me.Handle)
Dim mfont As New Font("宋体", 20)
Dim mstringformat As New StringFormat
mstringformat.Alignment = StringAlignment.Center
mstringformat.LineAlignment = StringAlignment.Center
g.DrawString("X071616", mfont, Brushes.Black, 75, 328, mstringformat)
If ListBox1.Items.Count = 0 Then selectsound() : Exit Sub
playsound()
End Sub
Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
Me.AxWindowsMediaPlayer1.settings.volume = TrackBar1.Value
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If Timer1.Enabled = False Then
Timer1.Enabled = True
Else
Timer1.Enabled = False
End If
If i = 0 Then
Me.AxWindowsMediaPlayer1.Ctlcontrols.pause()
i = 1
Button3.Text = "继续"
Exit Sub
End If
If i = 1 Then
Me.AxWindowsMediaPlayer1.Ctlcontrols.play()
Button3.Text = "暂停"
i = 0
Exit Sub
End If
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
j = True
playsound()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.AxWindowsMediaPlayer1.Ctlcontrols.stop()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim string1, ss, sss As String
string1 = ListBox1.SelectedItem.ToString.Substring(ListBox1.SelectedItem.ToString.LastIndexOf("\") + 1)
filename = string1.Substring(0, string1.LastIndexOf("."))
luj = ListBox1.SelectedItem.ToString.Substring(0, ListBox1.SelectedItem.ToString.LastIndexOf(".")) + ".lrc"
Me.HScrollBar1.Value = https://www.04ip.com/post/Me.AxWindowsMediaPlayer1.Ctlcontrols.currentPosition / (Me.AxWindowsMediaPlayer1.currentMedia.duration + 0.001) * 1000
ss = Me.AxWindowsMediaPlayer1.Ctlcontrols.currentPositionString
Me.Label1.Text = ss
If Dir(luj)Nothing Then
Dim fr As System.IO.StreamReader = New System.IO.StreamReader(luj, System.Text.Encoding.Default)
sss = fr.ReadLine 'vb.netlrc校验我们读取的第一行歌词
While (sss"")
If (sss.LastIndexOf(ss)-1) Then '时间匹配vb.netlrc校验了歌词中的时间
Me.TextBox1.Text = sss.Substring(sss.LastIndexOf("]") + 1)
Form2.TextBox1.Text = Me.TextBox1.Text
End If
sss = fr.ReadLine
End While
Else
TextBox1.Text = "Not Find! 请从网上下载歌词vb.netlrc校验!"
Form2.TextBox1.Text = "Not Find! 请从网上下载歌词!"
End If
Label1.Text = "当前进度:" + Me.AxWindowsMediaPlayer1.Ctlcontrols.currentPositionString
End Sub
Private Sub HScrollBar1_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles HScrollBar1.Scroll

推荐阅读