push proxy, email

push proxy, email
 avatar
thiettb
plain_text
2 years ago
2.4 kB
3
Indexable
Never
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            start();
        }

        static void start()
        {
            string[] lines = System.IO.File.ReadAllLines(@"C:\Users\Admin\Downloads\2000_spotify.txt");
            System.Console.WriteLine("Contents of ip-US.txt = ");
            foreach (string line in lines)
            {
                string[] words = line.Split(':');
                var ip = words[0];
                var port = words[1];
                var user = words[2];
                var pass = words[3];
                addProxy(ip, port, user, pass);
            }

            //string[] lines = System.IO.File.ReadAllLines(@"C:\Users\Admin\Downloads\2000_spotify.txt");
            //foreach (string line in lines)
            //{
            //    addEmail(line, "a");
            //}
        }

        static void addProxy(string ip, string port, string user, string pass)
        {
            string endPoint = "http://192.168.11.66:3131/api/proxy/add";

            var data = new[]
            {
                new KeyValuePair<string, string>("Ip", ip),
                new KeyValuePair<string, string>("Port", port),
                new KeyValuePair<string, string>("Username", user),
                new KeyValuePair<string, string>("Password", pass)
            };

            var client = new HttpClient();

            client.PostAsync(endPoint, new FormUrlEncodedContent(data)).GetAwaiter().GetResult();
        }

        static void addEmail(string username, string password)
        {
            try
            {
                string endPoint = "http://192.168.11.66:3131/api/mail/add-mail";
                var data = new[]
                {
                new KeyValuePair<string, string>("Username", username),
                new KeyValuePair<string, string>("Password", password)
            };

                var client = new HttpClient();

                client.PostAsync(endPoint, new FormUrlEncodedContent(data)).GetAwaiter().GetResult();
            }
            catch (Exception ex)
            { 
            }
        }
    }
}