Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.IO;
- using xNet;
- using System.Threading;
- using System.Threading.Tasks;
- namespace AlexaRankParser
- {
- public partial class Form1 : Form
- {
- OpenFileDialog filename = new OpenFileDialog();
- SaveFileDialog savefilename = new SaveFileDialog();
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- CancellationTokenSource cts = new CancellationTokenSource();
- var opt = new ParallelOptions
- {
- CancellationToken = cts.Token,
- MaxDegreeOfParallelism = potoki
- };
- Parallel.ForEach(lines, opt, a => Send(a));
- savefilename.ShowDialog();
- using (var request = new HttpRequest())
- {
- var useraGENT = Http.ChromeUserAgent();
- string[] baza = File.ReadAllLines(filename.FileName, Encoding.Default);
- HttpResponse result;
- foreach (var m in baza)
- {
- result = request.Get("http://data.alexa.com/data?cli=10&dat=s&url=" + m);
- var URL = result.ToString();
- int startIndex = result.ToString().IndexOf("<SD>");
- int endIndex = result.ToString().LastIndexOf("/<SD>");
- int length = endIndex - startIndex + 1;
- /// File.AppendAllLines(savefilename.FileName, key);
- }
- }
- }
- private void button2_Click(object sender, EventArgs e)
- {
- filename.ShowDialog();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement