منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
محتاج كود فرز المواضيع بـListBox - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : قسم لغة الفيجوال بيسك VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=182)
+--- قسم : قسم اسئلة VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=183)
+--- الموضوع : محتاج كود فرز المواضيع بـListBox (/showthread.php?tid=16363)

الصفحات: 1 2


RE: محتاج كود فرز المواضيع بـListBox - CLARO - 09-07-16

طيب شباب
انا محتاج كود فرز لهذا القسم
http://www.ibda3araby.com/f27p50-montada


RE: محتاج كود فرز المواضيع بـListBox - CLARO - 10-07-16

بس.اعطوني.فكرة


RE: محتاج كود فرز المواضيع بـListBox - سعود - 10-07-16

(09-07-16, 08:08 AM)CLARO كتب : طيب شباب
انا محتاج كود فرز لهذا القسم
http://www.ibda3araby.com/f27p50-montada

اخي الكريم الفرز وانتهينا منه شوف:
1و 2
لكن انت غيرت الموضوع الى [1]

ثم  عاودت لاول سطر!!!
شيء غريب الصراحة.


RE: محتاج كود فرز المواضيع بـListBox - CLARO - 11-07-16

ي غالي مشروعك مو راضي يفتح
و مشروع الوادي بفرز المواضيع الي بصفحة رقم 1 فقط


RE: محتاج كود فرز المواضيع بـListBox - الوادي - 11-07-16

يا كلارو،

جرب هذا الكود بشرط ان تاخذ عنوان الصفحة الآولى فقط وهو يقرأ بقية الصفحات.
PHP كود :
Public Class Form1

    
Private Sub Button1_Click(sender As System.ObjectAs System.EventArgsHandles Button1.Click

        Dim url 
As String "http://www.ibda3araby.com/f27-montada"

        
Dim p As Integer 0
        Dim html 
As String ""
        
Do
            
Dim load As String = New Net.WebClient() With {.Encoding System.Text.Encoding.UTF8}.DownloadString(url.Split("-")(0) & "p" "-" url.Split("-")(1))
            If 
load.Contains("لا يوجد حالياً أي موضوع في هذا المنتدى"Then Exit Do
            
html &= load
            p 
+= 50
        Loop

        Dim dt 
As New DataTable
        dt
.Columns.Add("Title")
        
dt.Columns.Add("Link")

        
Dim matches As System.Text.RegularExpressions.MatchCollection System.Text.RegularExpressions.Regex.Matches(html"(?<=<h2 class=""topic-title""><a class=""topictitle"" href="").+?(?="">).+?(?=</a>)")

        For 
Each match As System.Text.RegularExpressions.Match In matches
            Dim r 
As DataRow
            r 
dt.NewRow
            Dim arr
() As String match.Value.Split(""">")
            
Dim title As String arr(1)
            
Dim link As String arr(0)
            If 
Not link.StartsWith("http://www.ibda3araby.com/"Then link "http://www.ibda3araby.com/" link

            r
.Item("Title") = title.Substring(1)
            
r.Item("Link") = link

            dt
.Rows.Add(r)
        
Next

        Me
.ListBox1.DataSource dt
        Me
.ListBox1.DisplayMember "Title"
        
Me.ListBox1.ValueMember "Link"

    
End Sub

    
Private Sub ListBox1_Click(sender As ObjectAs System.EventArgsHandles ListBox1.Click
        Me
.WebBrowser1.Navigate(ListBox1.SelectedValue)
    
End Sub

End 
Class