Hllo everyone. I am Gabriel from Romania (sorry for my bad english)
My problem is: I have 3 listbox (1.ID 2.Online ID 3.Offline id)
Now... From a .txt file or from a button an id/id`s are inserted in listbox 1.
A second button "check status" verifies if these id`s are on or off and then pass in listbox online if are online or listbox offline if offline.. hope you understand what i want to do... i must use webclient and opi from yahoo as a condition
private void btnCheckStatus_Click(object sender, EventArgs e)
{
HttpRequestCachePolicy policy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(@"http://opi.yahoo.com/online?u=Id&m=0&t=0");
request.CachePolicy = policy;
Stream stream = request.GetResponse().GetResponseStream();
byte[] buffer = new byte[1024];
stream.Read(buffer, 0, buffer.Length);
stream.Close();
String st = Encoding.ASCII.GetString(buffer, 0, buffer.Length);
int count = listBox1.Items.Count;
for (int i = 0; i <= listBox1.Items.Count-1; i++)
{
if (count != 0)
{
listBox2.Items.Add(listBox1.SelectedItems[i]);
}
else
{
listBox3.Items.Add(listBox1.SelectedItems[i]);
}
listBox1.SelectedItems.Clear();
}
}
this is my code ... but i know is wrong :|
help please....