示例#1
0
        private static async void WebRequest(int reqNum)
        {
            var    results = new List <string>();
            string s       = string.Empty;

            foreach (var uri in GetMimeList().Take(reqNum))
            {
                try
                {
                    s = await WebReq.Request(uri);

                    results.Add(s);
                }
                catch (Exception ex)
                {
                    Console.WriteLine($"Exception: {ex.Message}");
                }
            }
            Console.WriteLine($"Count: {results.Count}");
            Console.WriteLine("Length:");
            for (int i = 0; i < results.Count; i++)
            {
                Console.WriteLine($"\t{i+1}: {results[i].Length}char");
            }
        }
示例#2
0
        private static async void WebRequestX()
        {
            var sr = await WebReq.RequestX(Mime.html1);

            Console.WriteLine(sr);
        }