Ejemplo n.º 1
0
        public static async Task UpdateProxy()
        {
            ProxyParser proxyParser = new ProxyParser();

            await Task.Factory.StartNew(() =>
            {
                proxyParser.UpdateData();
            });
        }
Ejemplo n.º 2
0
        public async Task <IList <IDrummerProxy> > GetProxiesAsync()
        {
            var proxies = new List <IDrummerProxy>();

            if (!File.Exists(filePath))
            {
                return(proxies);
            }

            var lines = File.ReadAllLines(filePath);

            if (lines == null || lines.Length < 1)
            {
                return(proxies);
            }
            await Task.Run(() =>
            {
                var parser = new ProxyParser(lines);
                proxies    = parser.Parse();
            });

            return(proxies);
        }