(19-05-17, 11:29 PM)alma2 كتب : ضع الكود كامل الذي أنشأت به ملف xml
الملف منشة من قبل موقع اخر
ما عندي فكرة عنه
بس انا الكود اللي عندي شغال بس ما يسحب جميع الاسطر المطلوبه
كود :
Dim url As String = String.Format("https://www.hamqth.com/xml.php?id={0}&callsign={1} &prg=BKLOG", Label17.Text, calls.Text)
Dim document As New XmlTextReader(url)
'loop through the xml file
While (document.Read())
Dim type = document.NodeType
'if node type was element
If (type = XmlNodeType.Element) Then
'if the loop found a <FirstName> tag
If (document.Name = "adr_name") Then
Lfullname.Text = document.ReadInnerXml
End If
If (document.Name = "us_state") Then
state.Text = document.ReadInnerXml
End If
'if the loop found a <FirstName> tag
If (document.Name = "qth") Then
qth.Text = document.ReadInnerXml
End If
'if the loop found a <FirstName> tag
If (document.Name = "grid") Then
WORKinfo.GRIDSQUARE.Text = document.ReadInnerXml
End If
'if the loop found a <FirstName> tag
If (document.Name = "qsl_via") Then
WORKinfo.Lqslmgr.Text = document.ReadInnerXml
End If
'if the loop found a <FirstName> tag
If (document.Name = "latitude") Then
WORKinfo.LAT.Text = document.ReadInnerXml
End If
'if the loop found a <FirstName> tag
If (document.Name = "longitude") Then
WORKinfo.LON.Text = document.ReadInnerXml
End If
End If
End While
End Subيسحب اول ثلاث اسطر
كود :
'if the loop found a <FirstName> tag
If (document.Name = "adr_name") Then
Lfullname.Text = document.ReadInnerXml
End If
If (document.Name = "us_state") Then
state.Text = document.ReadInnerXml
End If
'if the loop found a <FirstName> tag
If (document.Name = "qth") Then
qth.Text = document.ReadInnerXml
End Ifوهذا الملف
(19-05-17, 11:39 PM)alma2 كتب : تستطيع استغلال DataSet وعرضها في DataGridView مع تحديد اسم الجدول وهو هنا Callsign حسب طلبك
كود :
Dim ds As New DataSet
ds.ReadXml(url)
Me.DataGridView1.DataSource = ds.Tables("Callsign")
تسلم استاذي بس
انا محتاج اعرض النتائج في
textbox

