i want to filter items from list view , i want to remove every kind of items from it but these

202.38.95.66:1080
67.191.234.52:1158
125.88.125.201:1080
65.30.204.106:1188
83.183.96.123:45712
72.74.41.97:46331
69.42.126.106:46486
69.42.126.106:46486
60.241.65.32:47501
60.241.65.32:47501
173.16.5.49:47708
173.16.5.49:47708
93.176.11.69:48293
93.176.11.69:48293
71.114.46.27:48505

i just want to show these items in list

Recommended Answers

All 8 Replies

What is the source of data, is it stored in a database ?

Are these samples IP addresses and port numbers ?

just want to show these kind of items in list view i forgot to tell

Will the values you showed us above be the same always, or is it returned from a database etc. How will you know what are the IP's you want to display from an entire list?

no bro it will b changed every time this is example of this
kind of items

projet have 1 list view

1 load button

1 button to remove all other items <=== (need code for this , when i press button it remove every thing but ips and ports)

these are ips and ports

If the data format is consistent and is being stored in a database, you can filter it out at DB level based on the availability of colon (:) and period (.) in the string. But if it not consistent accross it will populate other data also.

for example

If you have some data like
ho.ney.be.e:2090
it will also be populated in the control.

Simple because it matches the pattern even though it is not a valid Ip address and port number combination.

I would first get all the data to a list box, say something like this ...

71.114.46.27:48505
string characters here
71.114.46.27:48505
more strings
71.114.46.27:48505 and some string
more string and 71.114.46.27:48505

The sub below will check if a number is returned after the "." AND ":" has been removed. if it contains only a number, it will form part of your ip address, show it in a listview...

Private Sub ShowIp()

Dim xList As Integer
Dim strIP As String

On Error Resume Next

For xList = 0 To List1.ListCount - 1
    List1.ListIndex = xList

    strIP = Replace$(List1.Text, ".", "")
    strIP = Replace$(strIP, ":", "")

    If IsNumeric(strIP) Then
        List2.AddItem List1.Text
        ''For testing purposes. You need to add the code to load the listview with the data...
            Else
        ''Not an IP address, do nothing...
    End If
Next xList
End Sub

Only a sample, you still need to adapt the code to fit your needs.

not working i try it it just make my application freez and take 100% process

application grabb data from http://www.socks5list.com/

and then show every thing in list1

i want to filter all data so list 1 show only proxies

If you remember your previous thread, we have covered everything there on how to get the data into LISTBOXES and then into LISTVIEW. Combine the 2 and it will work. I have written that code before I posted it here and it worked fine with almost no resources involved. Your app is freezing because you have a loop running as in my code but without listboxes to manipulate teh data...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.