public Program() { if (File.Exists(_filename)) { string s = File.ReadAllText(_filename); foreach (Match _Match in Regex.Matches(s, @"(.+)\:(.+)")) { _List.Add(new Ip { ip = _Match.Groups[1].Value, port = int.Parse(_Match.Groups[2].Value) }); } } new Thread(Start).Start(); _GetProxies = new GetProxies(); new CheckProxies().StartAsync(); _GetProxies.StartClipboardCheck(); }
void LoadProxies() { Console.WriteLine("Please wait while proxies are loaded and checked...."); GetProxies getProxies = new GetProxies(); proxyList = getProxies.LoadProxies(); int count = proxyList.Count; int i = 1; foreach (var p in proxyList) { if (getProxies.IsProxyAlive(p)) { Console.WriteLine("[{0}/{1}] " + p.ToString() + " is alive", i, count); p.isAlive = true; } else { Console.WriteLine("[{0}/{1}] " + p.ToString() + " is dead", i, count); } ++i; } Console.WriteLine("[Finished Loading] {0} proxies are alive.", getProxies.CountAlive(proxyList)); }
public Task <List <ProxyVm> > Handle(GetProxies request, CancellationToken cancellationToken) { return(_context.Proxies.ProjectTo <ProxyVm>(_mapper.ConfigurationProvider).ToListAsync(cancellationToken)); }