تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
بحث في اسطر listbox
#11
نجح الكود كل الشكر لك استاذ سعود

سااسميك دكتور الفيوجال بيسك
الرد }}}
تم الشكر بواسطة: سعود
#12
(06-05-22, 05:06 AM)dasktop كتب : نجح الكود كل الشكر لك استاذ سعود

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

العفو اخي الكريم
الرد }}}
تم الشكر بواسطة: dasktop
#13
(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 يحدد عليه 

ولم يحدد لماذا 
الرد }}}
تم الشكر بواسطة:
#14
إقتباس :ولم يحدد لماذا 
شي طبيعي لان بعد 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 
الرد }}}
تم الشكر بواسطة: dasktop , dasktop
#15
كل الشكر لك استاذ سعود وتم الانتهاء من البرنامج بنجاح 

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

http://vb4arb.com/vb/showthread.php?tid=...#pid181946
الرد }}}
تم الشكر بواسطة:



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


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