تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
معرفة عدد صفحات قسم معين من المنتدى
#5
Raggi Tech كتب :اولا اسف للضحك ولكن انا لحظت ان حضرتك ركزتي على اني لم اساعد حضرتك اكثر من تركيز حضرتك على طلبك
ثانيا كنت احب ان اشرح الكود و لكن اليك الكود
كود :
Private Sub fpages()
كود :
[color=#000080][SIZE=2][FONT=tahoma][b] On Error Resume Next[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]        'لاتوجد مشاركات في هذا القسم.[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]        Dim search = "لاتوجد مشاركات في هذا القسم."[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]        Dim where = InStr(WB.Document.Body.InnerHtml, search)[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]        If where <= 0 Then[/b][/FONT][/SIZE][/color]

[color=#000080][SIZE=2][FONT=tahoma][b]            Dim Elems As HtmlElementCollection[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]            Dim WebOC As Windows.Forms.WebBrowser = WB[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]            Dim numpost As Integer = 0[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]            Elems = WebOC.Document.GetElementsByTagName("TD")[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]            For num = 0 To Elems.Count[/b][/FONT][/SIZE][/color]

[color=#000080][SIZE=2][FONT=tahoma][b]                If InStr(Elems.Item(num).InnerHtml, "vbmenu_control") Then[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                    If numpost = 0 Then[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                        Dim Testpage As String = Elems.Item(num).InnerHtml[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                        Dim MyOutput, MyOutput2 As String[/b][/FONT][/SIZE][/color]

[color=#000080][SIZE=2][FONT=tahoma][b]                        MyOutput = GetStringBetween(Testpage, "<TD style=" & Chr(34) & "FONT-WEIGHT: normal" & Chr(34) & " class=vbmenu_control>", "</TD>")[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                        text1.Text = MyOutput[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                        Dim x = InStr(text1.Text, "صفحة " & pagenum.Text & " من ")[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                        If x > 0 Then[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                            text1.SelectionStart = x - 1[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                            text1.SelectionLength = Len("صفحة " & pagenum.Text & " من ")[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                            text1.SelectedText = ""[/b][/FONT][/SIZE][/color]

[color=#000080][SIZE=2][FONT=tahoma][b]                            lastpagenum.Text = text1.Text[/b][/FONT][/SIZE][/color]



[color=#000080][SIZE=2][FONT=tahoma][b]                            If pagenum.Text > 1 Then[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                                prevpage.Enabled = True[/b][/FONT][/SIZE][/color]

[color=#000080][SIZE=2][FONT=tahoma][b]                                If pagenum.Text = lastpagenum.Text Then[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                                    nextpage.Enabled = False[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                                ElseIf pagenum.Text < lastpagenum.Text Then[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                                    nextpage.Enabled = True[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                                End If[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                            ElseIf pagenum.Text = 1 Then[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                                prevpage.Enabled = False[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                                nextpage.Enabled = True[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                            End If[/b][/FONT][/SIZE][/color]

[color=#000080][SIZE=2][FONT=tahoma][b]                            pages.Text = "Page " & pagenum.Text & " OF " & lastpagenum.Text[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                            getposts()[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                            gb2.Enabled = True[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                            pages.Left = 50[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                        Else[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                            pages.Text = "Only One Page"[/b][/FONT][/SIZE][/color]

[color=#000080][SIZE=2][FONT=tahoma][b]                            pagenum.Text = "0"[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                            lastpagenum.Text = "0"[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                            nextpage.Enabled = False[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                            prevpage.Enabled = False[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                            getposts()[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                            gb2.Enabled = True[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                        End If[/b][/FONT][/SIZE][/color]

[color=#000080][SIZE=2][FONT=tahoma][b]                        numpost = 1[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                    End If[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]                End If[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]            Next[/b][/FONT][/SIZE][/color]
[color=#000080][SIZE=2][FONT=tahoma][b]        End If[/b][/FONT][/SIZE][/color]

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

واسف لحضرتك مره ثانية
وشكراً

ملاحظه : انا مجرد مبتدئ في البرمجه و ليس بالضروري اني مراقب منتدى فاكن محترف في البرمجه الرقابه ما هي الا متابعة المواضيع والمساعدة قدر الامكان

واسف لحضرتك مره ثالثه

تحياتي لك
مؤمن



ردك كتير مشوش ولم يعمل معي.
الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
معرفة عدد صفحات قسم معين من المنتدى - بواسطة فاتن_mybb_import4820 - 07-10-12, 01:17 AM

المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  اريد كود معين اثابكم الله خالد كامل1 1 461 04-02-25, 09:28 PM
آخر رد: aliday03
  كيفية احتساب الفرق بين تاريخين بناء على عدد معين مصمم هاوي 2 558 15-01-25, 02:02 PM
آخر رد: مصمم هاوي
  [سؤال] اضافة ملف Pdf الى الريسورس واستخراجه الى مسار معين .. ackore 6 614 15-11-24, 02:51 AM
آخر رد: justforit
  كيفية معرفة الجهاز رئيسي ام فرعي المتألق9 1 404 13-11-24, 06:41 PM
آخر رد: justforit
  معرفة عدد صفوف الجريد فيو بشرط معين modymody300894 4 667 12-11-24, 02:22 PM
آخر رد: salamandal
  كتابه عدد معين من الارقام داخل تيكست بوكس modymody300894 3 570 07-11-24, 09:15 PM
آخر رد: modymody300894
  كيفية معرفة تاريخ انشاء ملف وحدفه المتألق9 2 515 07-11-24, 08:54 AM
آخر رد: F.H.M
  معرفة حجم ملف PDF تم تحديد مساره modymody300894 1 304 10-08-24, 03:35 PM
آخر رد: ميدو الفنان
  أريد معرفة الطريقة ؟! saud1004 2 366 26-07-24, 12:15 PM
آخر رد: saud1004
  طباعة تقرير بطول وعرض معين (التقرير عبارة عن سطر) atefkhalf2004 7 643 15-07-24, 01:53 AM
آخر رد: atefkhalf2004

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم