问候伙计们这是我第一次访问这里我遇到了从 xml 文件中获取一些数据的问题
VB代码是
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If (ComboBox1.Text = "") Then
MessageBox.Show("No file name entered")
Else
Dim document As XmlReader = New XmlTextReader("http://gdata.youtube.com/feeds/api/users/kavvsona")
While (document.Read())
Dim type = document.NodeType
If (type = XmlNodeType.Element) Then
If (document.Name = "yt:statistics/viewCount") Then
xmlMyName.Visible = True
xmlMyName.Text = document.ReadInnerXml.ToString()
End If
If (document.Name = "yt:statistics/viewCount/") Then
xmlMyEmail.Visible = True
xmlMyEmail.Text = document.ReadInnerXml.ToString()
End If
If (document.Name = "viewCount") Then
xmlMyTel.Visible = True
xmlMyTel.Text = document.ReadInnerXml.ToString()
End If
If (document.Name = "Notes") Then
xmlMyNotes.Visible = True
xmlMyNotes.Text = document.ReadInnerXml.ToString()
End If
End If
End While
End If
End Sub
And the xml file is available under this link http://gdata.youtube.com/feeds/api/users/kavvsona
I want extract following information :
<yt:statistics lastWebAccess='1970-01-01T00:00:00.000Z' subscriberCount='9574' videoWatchCount='0' viewCount='120873' totalUploadViews='2374024'/>
<media:thumbnail url='http://i1.ytimg.com/i/T1ybzRP4iTT7NU6qbhV24g/1.jpg?v=51064230'/><yt:username>kavvsona</yt:username>
I have got no idea how to get it out of the yt: thing and the attribute. Please help me
谢谢