Post: Cycle through a list of proxies
08-21-2016, 12:30 PM #1
Ethen
Banned
(adsbygoogle = window.adsbygoogle || []).push({});
So i am just experimenting with VB, and i tried to googled this issue but i couldn't find the correct help.

What i want to do:

First let me tell you im not using a WebBrowser in my application. I am using
     HttpWebRequest, WebRequest


I would like to load a list of proxies to a list box, and once a button is pressed to access a website, i want it to cycle through each proxy in the listbox.

You must login or register to view this content.

Obviously, the Run will have the request for the website, i just wanna see if i can understand how to cycle through a list of proxies with one press of a button.
08-21-2016, 12:49 PM #2
Not exactly sure what you were asking but here's how you can import "proxies" from a text file in to your listbox
    
using(var stream = new StreamReader("/path/to/proxies.txt")) {
while (stream.Peek() >= 0)
listBox1.Items.Add(stream.ReadLine());
}


And here's how you can iterate through all the items in the list
    
foreach(string item in listBox1.Items) {
//do something with item
}


I know it's C# but it doesn't even require half a brain to convert it.

The following user thanked John for this useful post:

Ethen

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo