private static void SetAuto() { var proxyListProviders = MapperProvider.Load("mappers").ToList(); Random d = new Random(); int index = d.Next(0, proxyListProviders.Count - 1); IProxyListProvider provider = proxyListProviders[index]; List <Proxy> proxies = provider.GetProxyList().ToList(); int proxyIndex = d.Next(0, proxies.Count - 1); Proxy proxy = proxies[proxyIndex]; var proxySetter = GetProxySetter(); if (proxySetter != null) { proxySetter.Set(proxy.Host, proxy.Port); } }