示例#1
0
        public float getLoadTime(string URL)
        {
            float loadTime = 0;

            if (Nurl.isURL(URL))
            {
                var timeBefore = DateTime.Now;
                getContent(URL);
                var timeAfter = DateTime.Now;
                loadTime = (timeAfter - timeBefore).Milliseconds;
            }
            return(loadTime);
        }
示例#2
0
        public string getContent(string URL)
        {
            string content = "";

            if (Nurl.isURL(URL))
            {
                var webClient = new System.Net.WebClient();
                content = webClient.DownloadString(URL);
                //Suppression du retour à la ligne '\n'
                content = content.Remove(content.Length - 1);
            }

            return(content);
        }
示例#3
0
        public void testIsURL(string URL, Boolean expected)
        {
            var result = Nurl.isURL(URL);

            Assert.AreEqual(result, expected, "Erreur testIsURL");
        }