/// <summary>
 /// Starts the timer and forwards the call to the underlying UrlRequest instance.
 /// The timer result is written on the console.
 /// </summary>
 /// <param name="url">The url</param>
 /// <param name="username">The username to access protected url</param>
 /// <param name="password">The password to access protected url</param>
 /// <returns>The content of the given url as a string</returns>
 public string GetUrlContent(string url, string username, string password)
 {
     string result = null;
     using (var consoleStopwatch = new OutputStopwatch("Method 'string GetUrlContent(string url, string username, string password)', Duration (ms): {0}"))
     {
         result =  _urlRequest.GetUrlContent(url, username, password);
     }
     return result;
 }
Beispiel #2
0
        /// <summary>
        /// Starts the timer and forwards the call to the underlying UrlRequest instance.
        /// The timer result is written on the console.
        /// </summary>
        /// <param name="url">The url</param>
        /// <param name="username">The username to access protected url</param>
        /// <param name="password">The password to access protected url</param>
        /// <returns>The content of the given url as a string</returns>
        public string GetUrlContent(string url, string username, string password)
        {
            string result = null;

            using (var consoleStopwatch = new OutputStopwatch("Method 'string GetUrlContent(string url, string username, string password)', Duration (ms): {0}"))
            {
                result = _urlRequest.GetUrlContent(url, username, password);
            }
            return(result);
        }