Imports System.Net
Public Class Form1
Private Sub getpost()
Dim h As New HtmlAgilityPack.HtmlWeb
Dim d As HtmlAgilityPack.HtmlDocument = h.Load("http://islamweb.net/ar/consult/index.php?page=Details&id=2446968", "Get")
For Each n As HtmlAgilityPack.HtmlNode In d.DocumentNode.SelectNodes("//div[@itemprop='text']")
TextBox1.Invoke(Sub() TextBox1.Text = d.DocumentNode.SelectSingleNode("//div[@itemprop='text']").InnerText)
Button1.Invoke(Sub() Button1.Text = "تم")
Button1.Invoke(Sub() Button1.Enabled = True)
Exit Sub
Exit For
Next
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim th As New Threading.Thread(AddressOf getpost)
If th.IsAlive = False Then
Button1.Text = "إنتظر..."
Button1.Enabled = False
th.Start()
End If
End Sub
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
ServicePointManager.SecurityProtocol = DirectCast(3072, SecurityProtocolType)
End Sub
End Class