منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
[سؤال] ظهور جزء معين من موقع - نسخة قابلة للطباعة

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



ظهور جزء معين من موقع - ابو روضة - 20-10-17

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

http://saaid.net/gesah/410.htm

ما اريده فقط هذا الجزء الى اخر الصفحة طبعا يعنى اللى فيه الكتابة فقط




RE: ظهور جزء معين من موقع - a.ahmed - 20-10-17

PHP كود :
Dim h As String = New Net.WebClient().DownloadString("http://saaid.net/gesah/410.htm")
Dim s As String System.Text.RegularExpressions.Regex.Match(h"(<table width=""98%"" border=""0"" cellspacing=""0"" cellpadding=""7"">).+?(</table>)"System.Text.RegularExpressions.RegexOptions.Singleline).Value
Me
.WebBrowser1.DocumentText 



RE: ظهور جزء معين من موقع - ابو روضة - 20-10-17

(20-10-17, 07:44 PM)a.ahmed كتب :
PHP كود :
Dim h As String = New Net.WebClient().DownloadString("http://saaid.net/gesah/410.htm")
Dim s As String System.Text.RegularExpressions.Regex.Match(h"(<table width=""98%"" border=""0"" cellspacing=""0"" cellpadding=""7"">).+?(</table>)"System.Text.RegularExpressions.RegexOptions.Singleline).Value
Me
.WebBrowser1.DocumentText 

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


RE: ظهور جزء معين من موقع - ابو روضة - 20-10-17

(20-10-17, 09:37 PM)a.ahmed كتب : Remove WebBrowser1
Remove ListBox2
Remove Button1
Remove Label1

PHP كود :
Public Class Form1

    Dim dic 
As New Dictionary(Of StringString)

 
   Private Sub ListBox1_SelectedIndexChanged(ByVal sender As ObjectByVal e As EventArgsHandles ListBox1.SelectedIndexChanged
        Dim h 
As String = New Net.WebClient().DownloadString(dic(sender.text))
 
       Dim s As String System.Text.RegularExpressions.Regex.Match(h"(<table width=""98%"" border=""0"" cellspacing=""0"" cellpadding=""\d+"">).+?(</table>)"System.Text.RegularExpressions.RegexOptions.Singleline).Value
        Me
.WebBrowser2.DocumentText s
    End Sub

    Private Sub Form1_Load
(ByVal sender As ObjectByVal e As EventArgsHandles MyBase.Load
        Dim h 
As String = New Net.WebClient().DownloadString("http://www.saaid.net/mohamed/m.htm")
 
       Dim matches As System.Text.RegularExpressions.MatchCollection System.Text.RegularExpressions.Regex.Matches(h"<font size=""\d+""><a href=""\d+.htm""><font color="".+"">.+[\r\n]?.+</font></a></font></td>")
 
       For Each m As System.Text.RegularExpressions.Match In matches
            Dim v 
As String m.Value.Replace(vbNewLine" ")
 
           Dim l As String "http://www.saaid.net/mohamed/" System.Text.RegularExpressions.Regex.Match(v"(?<=<font size=""4""><a href="")\d+\.htm?(?="">)").Value
            Dim t 
As String Net.WebUtility.HtmlDecode(System.Text.RegularExpressions.Regex.Replace(v"<.*?>"""))
 
           dic.Add(tl)
 
           ListBox1.Items.Add(t)
 
       Next
    End Sub

End 
Class 



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


زادك الله علما نافعاً



RE: ظهور جزء معين من موقع - a.ahmed - 20-10-17

Remove WebBrowser1
Remove ListBox2
Remove Button1
Remove Label1

PHP كود :
Public Class Form1

    Dim dic 
As New Dictionary(Of StringString)

 
   Private Sub ListBox1_SelectedIndexChanged(ByVal sender As ObjectByVal e As EventArgsHandles ListBox1.SelectedIndexChanged
        Dim h 
As String = New Net.WebClient().DownloadString(dic(sender.text))
 
       Dim s As String System.Text.RegularExpressions.Regex.Match(h"(<table width=""98%"" border=""0"" cellspacing=""0"" cellpadding=""\d+"">).+?(</table>)"System.Text.RegularExpressions.RegexOptions.Singleline).Value
        Me
.WebBrowser2.DocumentText s
    End Sub

    Private Sub Form1_Load
(ByVal sender As ObjectByVal e As EventArgsHandles MyBase.Load
        Dim h 
As String = New Net.WebClient().DownloadString("http://www.saaid.net/mohamed/m.htm")
 
       Dim matches As System.Text.RegularExpressions.MatchCollection System.Text.RegularExpressions.Regex.Matches(h"<font size=""\d+""><a href=""\d+.htm""><font color="".+"">.+[\r\n]?.+</font></a></font></td>")
 
       For Each m As System.Text.RegularExpressions.Match In matches
            Dim v 
As String m.Value.Replace(vbLf" ")
 
           Dim l As String "http://www.saaid.net/mohamed/" System.Text.RegularExpressions.Regex.Match(v"(?<=<font size=""4""><a href="")\d+\.htm?(?="">)").Value
            Dim t 
As String Net.WebUtility.HtmlDecode(System.Text.RegularExpressions.Regex.Replace(v"<.*?>"""))
 
           dic.Add(tl)
 
           ListBox1.Items.Add(t)
 
       Next
    End Sub

End 
Class 

    Updated