Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. public void partChecking()
  2. {
  3. List<string> list = new List<string>(300);
  4. CustomWebClient customWebClient = new CustomWebClient();
  5. new NameValueCollection();
  6. for (;;)
  7. {
  8. object obj = this.lockForCheking;
  9. lock (obj)
  10. {
  11. if (this.lines.Count == 0)
  12. {
  13. break;
  14. }
  15. }
  16. list.Clear();
  17. int num = 0;
  18. while (num < 300 && !this.lines.IsEmpty)
  19. {
  20. string item;
  21. this.lines.TryDequeue(out item);
  22. list.Add(item);
  23. num++;
  24. }
  25. if (list.Count != 0)
  26. {
  27. NameValueCollection nameValueCollection = new NameValueCollection();
  28. nameValueCollection.Add("key", config.key);
  29. nameValueCollection.Add("type", this.insertParam);
  30. nameValueCollection.Add("lines", string.Join(" ", list.ToArray()));
  31. try
  32. {
  33. foreach (lineArray lineArray in JsonConvert.DeserializeObject<lineArray[]>(Encoding.UTF8.GetString(customWebClient.UploadValues("http://myrz.org/api/part_search.php", nameValueCollection))))
  34. {
  35. if (lineArray.is_private)
  36. {
  37. if (main.sngDomains.Contains(lineArray.line.Split(new char[]
  38. {
  39. ':'
  40. }).First<string>().Split(new char[]
  41. {
  42. '.'
  43. }).Last<string>(), StringComparer.OrdinalIgnoreCase))
  44. {
  45. this.savingMYR.Add(lineArray.line);
  46. }
  47. else
  48. {
  49. this.savingZABUGOR.Add(lineArray.line);
  50. }
  51. }
  52. else
  53. {
  54. if (Settings.Default.savePublic)
  55. {
  56. this.publicLines.Add(lineArray.line);
  57. }
  58. Interlocked.Increment(ref this.count_public);
  59. }
  60. Interlocked.Increment(ref this.count_checked);
  61. }
  62. continue;
  63. }
  64. catch (Exception ex)
  65. {
  66. MessageBox.Show(ex.Message);
  67. continue;
  68. }
  69. break;
  70. }
  71. break;
  72. }
  73. Thread.CurrentThread.Abort();
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement