Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void partChecking()
- {
- List<string> list = new List<string>(300);
- CustomWebClient customWebClient = new CustomWebClient();
- new NameValueCollection();
- for (;;)
- {
- object obj = this.lockForCheking;
- lock (obj)
- {
- if (this.lines.Count == 0)
- {
- break;
- }
- }
- list.Clear();
- int num = 0;
- while (num < 300 && !this.lines.IsEmpty)
- {
- string item;
- this.lines.TryDequeue(out item);
- list.Add(item);
- num++;
- }
- if (list.Count != 0)
- {
- NameValueCollection nameValueCollection = new NameValueCollection();
- nameValueCollection.Add("key", config.key);
- nameValueCollection.Add("type", this.insertParam);
- nameValueCollection.Add("lines", string.Join(" ", list.ToArray()));
- try
- {
- foreach (lineArray lineArray in JsonConvert.DeserializeObject<lineArray[]>(Encoding.UTF8.GetString(customWebClient.UploadValues("http://myrz.org/api/part_search.php", nameValueCollection))))
- {
- if (lineArray.is_private)
- {
- if (main.sngDomains.Contains(lineArray.line.Split(new char[]
- {
- ':'
- }).First<string>().Split(new char[]
- {
- '.'
- }).Last<string>(), StringComparer.OrdinalIgnoreCase))
- {
- this.savingMYR.Add(lineArray.line);
- }
- else
- {
- this.savingZABUGOR.Add(lineArray.line);
- }
- }
- else
- {
- if (Settings.Default.savePublic)
- {
- this.publicLines.Add(lineArray.line);
- }
- Interlocked.Increment(ref this.count_public);
- }
- Interlocked.Increment(ref this.count_checked);
- }
- continue;
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- continue;
- }
- break;
- }
- break;
- }
- Thread.CurrentThread.Abort();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement