منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : الكود سليم لكنه لا يعمل _HtmlAgilityPack
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
السلام عليكم ورحمة الله وبركاته...
بحاول جلب هذه المواضيع الموجودة هنا  داخل ليست بوكس لكنه لا يعمل وأعتقد أن الكود صحيح من وجهه نظرى انا لكن أكيد سيكون عند أحدكم رأى أخر وبكل تأكيد سيكون أجمل..
موقع الاستشارات


كود :
 Dim url As String = "https://islamweb.net/ar/consult/index.php?page=listing&pid=5064"
       Dim wc As New WebClient
       wc.Encoding = Encoding.UTF8
       Dim html As String = wc.DownloadString(url)
       Dim doc As New HtmlAgilityPack.HtmlDocument
       doc.LoadHtml(html)
       For Each n As HtmlAgilityPack.HtmlNode In doc.DocumentNode.SelectNodes("//*[@class='oneitems']/ul/li/h2/a[1]")
           ListBox1.Items.Add(n.InnerText)
           lst.Add("https://islamweb.net" & n.Attributes("href").Value)
       Next
هل اصبت الهدف ام لا
اقصد هل هذا هو المطلوب؟

PHP كود :
Public Class Form1
    Dim lst 
As New List(Of String)
 
   Private Sub gd(url As String)
 
       lst.Clear()
 
       ListBox1.Invoke(Sub() ListBox1.Items.Clear())
 
       Dim h As New HtmlAgilityPack.HtmlWeb
        Dim d 
As HtmlAgilityPack.HtmlDocument h.Load(url"Get")
 
       For Each n As HtmlAgilityPack.HtmlNode In d.DocumentNode.SelectNodes("//ul[@class='oneitems']//li/h2/a")
 
           ListBox1.Invoke(Sub() ListBox1.Items.Add(n.InnerText.Trim))
 
           lst.Add(n.Attributes("href").Value)
 
       Next
        Button1
.Invoke(Sub() Button1.Enabled True)
 
       Button1.Invoke(Sub() Button1.Text "تم")

 
   End Sub
    Private Sub Button1_Click
(sender As ObjectAs EventArgsHandles Button1.Click
        Dim u 
As String TextBox1.Text
        Dim th 
As New Threading.Thread(AddressOf gd)
 
       If th.IsAlive False Then
            Button1
.Enabled False
            Button1
.Text "انتظر..."
 
           th.Start(u)
 
       End If
 
   End Sub
End 
Class 
(06-02-21, 08:21 PM)سعود كتب : [ -> ]
هل اصبت الهدف ام لا
اقصد هل هذا هو المطلوب؟

PHP كود :
Public Class Form1
    Dim lst 
As New List(Of String)
 
   Private Sub gd(url As String)
 
       lst.Clear()
 
       ListBox1.Invoke(Sub() ListBox1.Items.Clear())
 
       Dim h As New HtmlAgilityPack.HtmlWeb
        Dim d 
As HtmlAgilityPack.HtmlDocument h.Load(url"Get")
 
       For Each n As HtmlAgilityPack.HtmlNode In d.DocumentNode.SelectNodes("//ul[@class='oneitems']//li/h2/a")
 
           ListBox1.Invoke(Sub() ListBox1.Items.Add(n.InnerText.Trim))
 
           lst.Add(n.Attributes("href").Value)
 
       Next
        Button1
.Invoke(Sub() Button1.Enabled True)
 
       Button1.Invoke(Sub() Button1.Text "تم")

 
   End Sub
    Private Sub Button1_Click
(sender As ObjectAs EventArgsHandles Button1.Click
        Dim u 
As String TextBox1.Text
        Dim th 
As New Threading.Thread(AddressOf gd)
 
       If th.IsAlive False Then
            Button1
.Enabled False
            Button1
.Text "انتظر..."
 
           th.Start(u)
 
       End If
 
   End Sub
End 
Class 

حبيبى أخى سعود تسلم من كل شر...
أكيد الكود صحيح الذى أرسلته حضرتك لكن أكيد يوجد شيئ ناقص بجهازى او خطأ فى نسخة
الويندوز أو أو ... لا أعلم صراحة ما سبب الخطأ هذا


(06-02-21, 08:36 PM)ابو روضة كتب : [ -> ]
(06-02-21, 08:21 PM)سعود كتب : [ -> ]
هل اصبت الهدف ام لا
اقصد هل هذا هو المطلوب؟

PHP كود :
Public Class Form1
    Dim lst 
As New List(Of String)
 
   Private Sub gd(url As String)
 
       lst.Clear()
 
       ListBox1.Invoke(Sub() ListBox1.Items.Clear())
 
       Dim h As New HtmlAgilityPack.HtmlWeb
        Dim d 
As HtmlAgilityPack.HtmlDocument h.Load(url"Get")
 
       For Each n As HtmlAgilityPack.HtmlNode In d.DocumentNode.SelectNodes("//ul[@class='oneitems']//li/h2/a")
 
           ListBox1.Invoke(Sub() ListBox1.Items.Add(n.InnerText.Trim))
 
           lst.Add(n.Attributes("href").Value)
 
       Next
        Button1
.Invoke(Sub() Button1.Enabled True)
 
       Button1.Invoke(Sub() Button1.Text "تم")

 
   End Sub
    Private Sub Button1_Click
(sender As ObjectAs EventArgsHandles Button1.Click
        Dim u 
As String TextBox1.Text
        Dim th 
As New Threading.Thread(AddressOf gd)
 
       If th.IsAlive False Then
            Button1
.Enabled False
            Button1
.Text "انتظر..."
 
           th.Start(u)
 
       End If
 
   End Sub
End 
Class 

حبيبى أخى سعود تسلم من كل شر...
أكيد الكود صحيح الذى أرسلته حضرتك لكن أكيد يوجد شيئ ناقص بجهازى او خطأ فى نسخة
الويندوز أو أو ... لا أعلم صراحة ما سبب الخطأ هذا


جرب حط الكود ده في الفورم لود
كود :
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
            ServicePointManager.SecurityProtocol = DirectCast(3072, SecurityProtocolType)
اخي الكريم انت خذ فقط الباترن ...احب دوما اجرب القصد الباترن فقطSmile
لكن تاكد من الرابط.

كنت مشغل vpn ولما قفلته ظهرت لي رسالة مماثلة.
اليوم السابع كتب : كتب :جرب حط الكود ده في الفورم لود
كود :
كود :
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
            ServicePointManager.SecurityProtocol = DirectCast(3072, SecurityProtocolType)
والله كنت ببحث عن هذا الكود لآنى نسيتو وضاع من جهازى لآنه حل لى مشاكل كبيرة..فعلا إكتمل الحل بفضل الله ثم بكود الاخ سعود ثم بهذا الكود...
جزاكم الله كل الخير والسعادة...
ملحوظة :-
لما ببعد شوية عن البرمجة بنسى أغلب ما تعلمته خلال يومين بالضبط  
(06-02-21, 08:47 PM)ابو روضة كتب : [ -> ]
(06-02-21, 08:40 PM)اليوم السابع كتب : [ -> ]جرب حط الكود ده في الفورم لود
كود :
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
            ServicePointManager.SecurityProtocol = DirectCast(3072, SecurityProtocolType)

والله كنت ببحث عن هذا الكود لآنى نسيتو وضاع من جهازى لآنه حل لى مشاكل كبيرة.

فعلا إكتمل الحل بفضل الله ثم بكود الاخ سعود ثم بهذا الكود...
جزاكم الله كل الخير والسعادة...
ملحوظة :-
لما ببعد شوية عن البرمجة بنسى أغلب ما تعلمته خلال يومين بالضبط  Big Grin

(06-02-21, 08:52 PM)سعود كتب : [ -> ]
اغلقت الـvpn وجربت الكود ولم يعمل 
ماهو عمل هذا الكود؟

والله يا أخى أنا عثرت عليه من سنتين تقريبا وضعه لى الأخ الكريم معاند الحظ كان بسبب مشكله مثل هذه
ونسيت وظيفته لكن أعتقد والله تعالى أعلى وأعلم بأنه يسمح بالولوج داخل المواقع فى وضع التخفى من خلال الأكواد وأعتقد
أيضا أنه على ويندوز 7 لن تحتاجه لآن ويندوز 10 حمايته قوية بعض الشيئ.

الحمدلله رب العالمين 
الكود ده بيعمل تخطي ل Ssl و Tls علشان حمايه المواقع 
و وبيعمل علي ويندوز 10 فقط