I think I have everything working so far. One error left if the local variable error for ‘req’ … its already been declared above System.Net.WebRequest req = null; but i’m trying to clear it before using for WebRequest req = WebRequest.Create… do I not need to do that?
while (listId.Items.Count > 0)
{
// making the first item as selected.
listId.SelectedIndex = 0;
foreach (object o in listProxy.Items)
{
string strProxy = o as string;
WebProxy proxyObject = new WebProxy(strProxy, true); // insert listProxy proxy here
WebRequest.DefaultWebProxy = proxyObject;
string strURL = "http://www.zzzz.com"; // link from listId and insert here
System.Net.WebRequest req = null;
try
{
WebRequest req = WebRequest.Create(strURL + "/book.php?qid=" + listId.SelectedItem as string);
req.Proxy = proxyObject;
req.Method = "POST";
req.Timeout = 5000;
}
catch (Exception eq)
{
string sErr = "Cannot connect to " + strURL + " : " + eq.Message;
MessageBox.Show(sErr, strURL, MessageBoxButtons.OK, MessageBoxIcon.Stop);
}
}
// remove the selected item.
listId.Items.RemoveAt(0);
// refreshing the list.
listId.Refresh();
}
Change:
To: