Advertisement
Guest User

Untitled

a guest
Aug 28th, 2013
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /Timer1
  2.         int start = 0;
  3.         private void timer1_Tick(object sender, EventArgs e)
  4.         {
  5.             if (Convert.ToInt32(textBox3.Text) > listBox1.Items.Count)
  6.             {
  7.                 WebClient wb = new WebClient();
  8.                 string html = wb.DownloadString("http://dayviews.com/p/ajax.html?action=loadInMoreGroupMembers&start=" + start.ToString() + "&diaryname=" + textBox1.Text);
  9.                 start += 36;
  10.                 MatchCollection m6 = Regex.Matches(html, "\"username\":\"\\s*(.+?)\\s*\"", RegexOptions.Singleline);
  11.                 foreach (Match m in m6) { listBox1.Items.Add(m.Groups[1].Value.ToString()); }
  12.  
  13.                 label1.Text = "Start: " + start.ToString();
  14.                 label2.Text = "Users: " + listBox1.Items.Count.ToString();
  15.             }
  16.             else
  17.             {
  18.                 timer1.Enabled = false;
  19.                 MessageBox.Show("Klar med " + listBox1.Items.Count.ToString() + " !");
  20.             }          
  21.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement