28-07-13, 05:45 AM
نحمده ونصلي على رسوله الكريم
المثال بالسي شارب :p
هذا الكود بعد ترجمته للبيسك ولكن من خلال موقع للترجمة ولا ادري هل هو صحيح 100% ام لا
المثال بالسي شارب :p
هذا الكود بعد ترجمته للبيسك ولكن من خلال موقع للترجمة ولا ادري هل هو صحيح 100% ام لا

كود :
[align=left]Public Partial Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private loaded As Boolean = False
Private i As Integer = 0
Private Sub Form1_Load(sender As Object, e As EventArgs)
loaded = True
End Sub
Private Sub wb_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs)
If Not loaded Then
Return
End If
i += 1
If i > 1 Then
Return
End If
Dim th As HtmlElementCollection = wb.Document.GetElementsByTagName("th"), td As HtmlElementCollection = wb.Document.GetElementsByTagName("td")
For Each h As HtmlElement In th
If h.OuterText.Contains("سعر") OrElse h.OuterText.Contains("اسعار") Then
lv.Items.Add(h.OuterText)
End If
If h.OuterText.Contains("اسعار كيلو الذهب") Then
Exit For
End If
Next
Dim t As Integer = 0, s As Integer = 0
For Each d As HtmlElement In td
If Not d.OuterText.Contains("اخر تحديث") Then
lv.Items(t).SubItems.Add(d.OuterText)
Else
Text = d.OuterText
Exit For
End If
s += 1
If s > 2 Then
t += 1
s = 0
End If
Next
lv.Enabled = True
UseWaitCursor = False
End Sub
End Class
[/align]