예제 #1
0
        static void Main(string[] args)
        {
start:
            Console.OutputEncoding = Encoding.UTF8;
            var ps = new ProxySelector();

            while (!UpdateProxySelector(ps))
            {
                Console.WriteLine("Failed retriving proxy list");
                Console.ReadLine();
            }
            var proxy = new NeteaseProxy(ps);

            proxy.Start();
            Console.WriteLine("Please change proxy of Netease Music to address 127.0.0.1,port 15213");
            Console.WriteLine("Press enter to use the next proxy");
            while (true)
            {
                var aproxy = ps.GetTop();
                if (aproxy == null)
                {
                    Console.WriteLine("No available proxy, retrying");
                    proxy.Stop();
                    goto start;
                }
                Console.WriteLine("Using: " + aproxy);
                Console.ReadLine();
                ps.Remove(aproxy);
            }
        }
예제 #2
0
        static void Main(string[] args)
        {
start:
            var ps = new ProxySelector();

            if (!UpdateProxySelector(ps))
            {
                Console.WriteLine("获取代理列表失败");
                Console.ReadLine();
                return;
            }
            var proxy = new NeteaseProxy(ps);

            proxy.Start();
            Console.WriteLine("请设置网易云音乐代理为127.0.0.1,端口15213");
            Console.WriteLine("如果播放失败,按回车切换到下一个代理服务器");
            while (true)
            {
                var aproxy = ps.GetTop();
                if (aproxy == null)
                {
                    Console.WriteLine("没有可用代理,重新搜索");
                    proxy.Stop();
                    goto start;
                }
                Console.WriteLine("现在使用的是:" + aproxy);
                Console.ReadLine();
                ps.Remove(aproxy);
            }
        }