I am using http web requests and want it to use different proxies.

This is my starting point:

Dim myproxy As New WebProxy("http://1.1.1.1:80")

I would like to populate the address section using an item from ListBox.

VB does not let me do it, because I am trying to convert a string to an address data type.

Is there a way?

有帮助吗?

解决方案

If you managed to solve your problem with the C# code you posted, VB could look like this:

Dim prx As String = "http://" & lstProxy.Items(x)
Dim myProxy As New WebProxy(prx)

And if you write same in C#, there is hardly any difference.

其他提示

Ok - could not figure it out! But have since switched to C#.net and it's all good.

I've handled it like this:

       string front = "http://";
       string prx = front + lstProxy.Items[x].ToString();

       WebProxy myProxy = new WebProxy(prx);

So, top advice from me is to get C#.Net. Feel free to comment on this if any help is needed.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top