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

نسخة كاملة : بحث في اسطر listbox
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
الصفحات : 1 2
نجح الكود كل الشكر لك استاذ سعود

سااسميك دكتور الفيوجال بيسك
(06-05-22, 05:06 AM)dasktop كتب : [ -> ]نجح الكود كل الشكر لك استاذ سعود

سااسميك دكتور الفيوجال بيسك

العفو اخي الكريم
(06-05-22, 05:51 PM)سعود كتب : [ -> ]
(06-05-22, 05:06 AM)dasktop كتب : [ -> ]نجح الكود كل الشكر لك استاذ سعود

سااسميك دكتور الفيوجال بيسك

العفو اخي الكريم

اخي سعود انا حدثت كودك التالي 

PHP كود :
   On Error Resume Next
        Dim ip 
As IPGlobalProperties IPGlobalProperties.GetIPGlobalProperties
        Dim p 
As TcpConnectionInformation() = ip.GetActiveTcpConnections
        For Each t In p
            Dim port 
As String t.RemoteEndPoint.Port
            Dim index 
As Integer ListBox1.Items.IndexOf(port)
 
           If index = -And (port 443 Or port 80Then
                ListBox1
.Items.Add(port)
 
           Else
                If index 
= -And (port <> 443 Or port <> 80 Then
                    ListBox1
.SetSelected(index)
 
                   MsgBox("توجد منافذ غير مدرجة"MsgBoxStyle.Exclamation"تنبيه")

 
               End If
 
           End If
 
       Next 


بااضافة                     ListBox1.SelectedItem(index) اذا في منفذ يختلف عن 443 و80 يحدد عليه 

ولم يحدد لماذا 
إقتباس :ولم يحدد لماذا 
شي طبيعي لان بعد else لم نضف بنود الى الـ ListBox 
اذا اردت ان يتم تحديد البورتات الاخرى تحتاج تفعيل الـ Selection Mod ضمن خصائص الـ ListBox ايضا  نعدل شوي على الكود بحيث لا نستخدم else  وانما بعد الانتهاء من الاسناد في الجملة الشرطية الاولى نخرج من الجملة ونقوم بتفحص القيم وبناءا عليه نحدد.
باذن الله ساعدل على الكود ان لم تسبقني ساكتب الكود.

PHP كود :
 Dim ip As IPGlobalProperties IPGlobalProperties.GetIPGlobalProperties
        Dim p 
As TcpConnectionInformation() = ip.GetActiveTcpConnections
        For Each t In p
            Dim port 
As String t.RemoteEndPoint.Port
            Dim index 
As Integer ListBox1.Items.IndexOf(port)
 
           If index = -1 Then
                ListBox1
.Items.Add(port)
 
           End If
 
       Next
        For r 
As Integer 0 To ListBox1.Items.Count 1
            Dim h 
As String ListBox1.Items(r)
 
           If (<> 443 And <> 80Then
                Dim i 
As Integer ListBox1.Items.IndexOf(h)
 
               ListBox1.SetSelected(iTrue)
 
           End If
 
       Next 

@@@@@@@@@@@@@@@@@@@@@@@@@
===================================
تعديـــــــــــــــل
PHP كود :
Dim ip As IPGlobalProperties IPGlobalProperties.GetIPGlobalProperties
        Dim p 
As TcpConnectionInformation() = ip.GetActiveTcpConnections
        For Each t In p
            Dim port 
As String t.RemoteEndPoint.Port
            Dim index 
As Integer ListBox1.Items.IndexOf(port)
 
           If index = -1 Then
                ListBox1
.Items.Add(port)
 
           End If
 
       Next
        For r 
As Integer 0 To ListBox1.Items.Count 1
            Dim h 
As String ListBox1.Items(r)
 
           If (<> 443 And <> 80Then
                ListBox1
.SetSelected(rTrue)
 
           End If
 
       Next 
كل الشكر لك استاذ سعود وتم الانتهاء من البرنامج بنجاح 

ويهمنا رايك هنا المشروع كامل

http://vb4arb.com/vb/showthread.php?tid=...#pid181946
الصفحات : 1 2