Advertisement
AhmedSokr

Untitled

Mar 11th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. private void button1_Click(object sender, EventArgs e)
  2. {
  3. webBrowser1.Navigate("https://m.facebook.com/messages/read/?fbid=" + listBox1.Text);
  4. C++;
  5. listBox1.SelectedItem = listBox1.Items[C - 1];
  6. timer1.Start();
  7. }
  8.  
  9. private void timer1_Tick(object sender, EventArgs e)
  10. {
  11. var links = webBrowser1.Document.GetElementsByTagName("textarea");
  12. foreach (HtmlElement link in links)
  13. {
  14. if (richTextBox1.Text == richTextBox1.Text)
  15. {
  16. link.InnerText = richTextBox1.Text;
  17. }
  18. timer2.Start();
  19. }
  20. }
  21.  
  22. private void timer2_Tick(object sender, EventArgs e)
  23. {
  24. var linkss = webBrowser1.Document.GetElementsByTagName("input");
  25. foreach (HtmlElement link in linkss)
  26. {
  27. if (link.Name == "Send" || link.Name == "send")
  28. {
  29. if (richTextBox1.Text != "")
  30. {
  31. link.InvokeMember("click");
  32. }
  33. }
  34. timer3.Start();
  35. }
  36. }
  37.  
  38. private void timer3_Tick(object sender, EventArgs e)
  39. {
  40. webBrowser1.Navigate("https://m.facebook.com/messages/read/?fbid=" + listBox1.Text);
  41. timer1.Start();
  42. C++;
  43. listBox1.SelectedItem = listBox1.Items[C - 1];
  44. }
  45.  
  46. private void button2_Click(object sender, EventArgs e)
  47. {
  48. listBox1.Items.Clear();
  49. OpenFileDialog theDialog = new OpenFileDialog();
  50. theDialog.Title = "Open Text File";
  51. theDialog.Filter = "TXT files|*.txt";
  52. if (theDialog.ShowDialog() == DialogResult.OK)
  53. {
  54. string Name = theDialog.FileName.ToString();
  55. if (File.Exists(Name))
  56. {
  57. var lines = File.ReadAllLines(Name);
  58. foreach (var line in lines)
  59. {
  60. listBox1.Items.Add(line);
  61. listBox1.SelectedItem = listBox1.Items[listBox1.Items.Count - 1];
  62. var ID = line.Split(new string[] { " : " }, StringSplitOptions.RemoveEmptyEntries);
  63. }
  64. }
  65. }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement