Loop thru listview
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
4 posts
Page 1 of 1
I have this code, it checks if a proxy ip is dead or alive, but i want it to loop thru my listview to see if every ip in the list is dead or alive and then add ex, "Alive" to a subitem in the listview
my code is
my code is
Code: Select all
This code is inside an backgroundworker to make my program lag less Dim ip As String = TextBox3.Text
Dim port As String = TextBox4.Text
Button9.Enabled = True
Button1.Enabled = False
If TextBox2.Text > "" Then
ElseIf TextBox2.Text < "" Then
label3.Text = "Please wait a moment"
Try
Dim siteUri As New System.Uri("http://www.google.dk")
Dim webRequest As System.Net.WebRequest = System.Net.WebRequest.Create(siteUri)
webRequest.Proxy = New System.Net.WebProxy(ip & ":" & port)
Dim webResponse As System.Net.WebResponse = webRequest.GetResponse()
label3.Text = ip & ":" & port & " Is active"
Catch ex As Exception
label3.Text = ip & ":" & port & " Is Inactive"
End Try
End If
Button1.Enabled = True
Button9.Enabled = False
I'll need to alter the code a bit to make it loop through a listview.
PM me your TeamViewer details.
PM me your TeamViewer details.
Instead of LOL use this -
LSIBMHBIWFETALOL
Which means -
Laughing silently in between my head because it wasn't funny enough to actually laugh out loud!
LSIBMHBIWFETALOL
Which means -
Laughing silently in between my head because it wasn't funny enough to actually laugh out loud!
Skillful wrote:I'll need to alter the code a bit to make it loop through a listview.give me a moment
PM me your TeamViewer details.

for each lvi as listviewitem in listview1.items
if checkalive(lvi.text) then
lvi.subitems(1).text = "alive"
else
lvi.subitems(1).text = "dead"
end if
next
if checkalive(lvi.text) then
lvi.subitems(1).text = "alive"
else
lvi.subitems(1).text = "dead"
end if
next
4 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023