Live2D 看板娘 / Demo

域名注册扫描2

太慢了。。。

上多线程 效果如果

 

static int i = 3800;
        static object locker = new object();
        static Thread t1, t2, t3, t4, t5;
        public static void Main()
        {

            t1 = new Thread(new ThreadStart(Get));
            t1.Start();
            t2 = new Thread(new ThreadStart(Get));
            t2.Start();
            t3 = new Thread(new ThreadStart(Get));
            t3.Start();
            t4 = new Thread(new ThreadStart(Get));
            t4.Start();
            t5 = new Thread(new ThreadStart(Get));
            t5.Start();
            Get();
            Console.ReadKey();
        }
        static void Get()
        {
            while (true)
            {
                lock (locker)
                {
                    i++;
                }
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://domains.qcloud.com/model/check_domains?_xsrf=2%7C5d7552a7%7C43470b559e8c49371fbbb27cb604708e%7C1451895495&t=1451896013002&domain=" + i.ToString() + "&tlds=.cn");
                HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                Stream ResStream = response.GetResponseStream();
                Encoding encoding = Encoding.GetEncoding("utf-8");
                StreamReader streamReader = new StreamReader(ResStream, encoding);
                string s = streamReader.ReadToEnd();

                JObject jo = (JObject)JsonConvert.DeserializeObject(s);
                string zone = jo["result"][0]["domain"].ToString();
                string jieguo = jo["result"][0]["reged"].ToString();
                Console.WriteLine(zone + "---->" + jieguo);
                if (jieguo == "False")
                {
                    Console.ReadKey();
                }
            }
        }
    }

 

posted @ 2016-01-04 17:28  MChuang  阅读(439)  评论(0编辑  收藏  举报