Advertisement
Guest User

Untitled

a guest
Feb 4th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.61 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Diagnostics;
  6. using System.Drawing;
  7. using System.IO;
  8. using System.Linq;
  9. using System.Security.Policy;
  10. using System.Text;
  11. using System.Threading;
  12. using System.Threading.Tasks;
  13. using System.Windows.Forms;
  14.  
  15. namespace WindowsFormsApp1
  16. {
  17. public partial class Form1 : Form
  18. {
  19. private Uri geturl;
  20. private string str;
  21.  
  22. public string Url { get; private set; }
  23.  
  24. public Form1()
  25. {
  26. InitializeComponent();
  27. }
  28.  
  29. private void button1_Click(object sender, EventArgs e)
  30. {
  31. if (openFileDialog1.ShowDialog() == DialogResult.OK);
  32. {
  33. StreamReader streamreader = new StreamReader(openFileDialog1.FileName);
  34. listBox1.Items.Clear();
  35. while (!streamreader.EndOfStream)
  36. {
  37. listBox1.Items.Add(streamreader.ReadLine());
  38. }
  39. label1.Text = "Акаунтов:" + listBox1.Items.Count;
  40. }
  41. }
  42.  
  43. string GetLine(string fileName, int line)
  44. {
  45. using (var sr = new StreamReader(fileName))
  46. {
  47. for (int i = 1; i < line; i++)
  48. sr.ReadLine();
  49. return sr.ReadLine();
  50. }
  51. }
  52.  
  53. private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
  54. {
  55.  
  56. }
  57.  
  58. private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
  59. {
  60. HtmlElementCollection theElementCollection = webBrowser1.Document.GetElementsByTagName("input");
  61.  
  62. foreach (HtmlElement curElement in theElementCollection)
  63. {
  64. string controlName = curElement.GetAttribute("id").ToString();
  65. if (controlName == "steamAccountName")
  66. {
  67. curElement.SetAttribute("Value", "12");
  68. //curElement.InnerText = "Your Email Address";
  69. }
  70. else
  71. {
  72. if (controlName == "steamPassword")
  73. {
  74. curElement.SetAttribute("Value", "12");
  75. //curElement.InnerText = "Your Password";
  76. }
  77. }
  78. }
  79.  
  80. foreach (HtmlElement curElement in theElementCollection)
  81. {
  82. string controlName = curElement.GetAttribute("login_btn_signin").ToString();
  83. curElement.InvokeMember("Click");
  84. }
  85. }
  86. private void button2_Click(object sender, EventArgs e)
  87. {
  88. for (int i = 0; i < listBox1.Items.Count; i++) {
  89. String data = listBox1.Items[i].ToString();
  90. String[] mass = data.Split(';');
  91. String user = mass[0];
  92. String pass = mass[1];
  93. webBrowser1.ScriptErrorsSuppressed = true;
  94. webBrowser1.Url = new Uri("https://steamcommunity.com/openid/login?openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.mode=checkid_setup&openid.return_to=http%3A%2F%2Fcsgo-login.pl%2Fsteamlogin.php&openid.realm=http%3A%2F%2Fcsgo-login.pl&openid.ns_sreg=http%3A%2F%2Fopenid.net%2Fextensions%2Fsreg%2F1.1&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select");
  95. MessageBox.Show(webBrowser1.DocumentText);
  96. HtmlElement us = webBrowser1.Document.GetElementById("steamAccountName");
  97. HtmlElement ps = webBrowser1.Document.GetElementById("steamPassword");
  98. if (us != null && ps != null) {
  99. us.SetAttribute("value", user);
  100. ps.SetAttribute("value", pass);
  101. }
  102. webBrowser1.Document.GetElementById("login_btn_signin").InvokeMember("Click");
  103. webBrowser1.Url = new System.Uri("https://csgokingdom.com/open/daily", System.UriKind.Absolute);
  104. System.Threading.Thread.Sleep(3000);
  105. HtmlElementCollection classButton = webBrowser1.Document.All;
  106.  
  107. foreach (HtmlElement element in classButton)
  108. {
  109. if (element.GetAttribute("className") == "style__controlButton___3pncb")
  110. {
  111. element.InvokeMember("click");
  112. break;
  113. }
  114. }
  115. }
  116. }
  117. }
  118. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement