public static void ScanResource(object request)
        {
            var values        = (List <object>)request;
            var castedRequest = ( HttpWebRequest )values[1];
            var details       = new ResponseDetails
            {
                Url      = castedRequest.RequestUri,
                UserName = ( string )values[0]
            };

            try
            {
                using (var response = ( HttpWebResponse )castedRequest.GetResponse())
                {
                    foreach (Cookie cookie in response.Cookies)
                    {
                        _cookieContainer.Add(response.ResponseUri, cookie);
                    }

                    WriteResponseInfo(response, details);
                    response.Close();
                }
            }
            catch (WebException ex)
            {
                WriteResponseInfo(( HttpWebResponse )ex.Response, details);
            }
        }
        private static void WriteResponseInfo(HttpWebResponse response, ResponseDetails details)
        {
            details.Response = String.Format("{0}{1}{2}", Convert.ToString(( int )response.StatusCode), ' ', response.StatusDescription);

            using (var reader = new StreamReader(response.GetResponseStream(), Encoding.ASCII))
            {
                details.SearchResult = reader.ReadToEnd();
            }

            if (ResponseDetails != null)
            {
                ResponseDetails.Add(details);
            }
        }
        private void SearchSpecificContent(ResponseDetails details, string searchText)
        {
            var doc = new HtmlDocument();

            doc.LoadHtml(details.SearchResult);

            var body       = doc.DocumentNode.SelectNodes("//body");
            var title      = doc.DocumentNode.SelectNodes("//title");
            var resultCopy = details.SearchResult;

            details.SearchResult = "Not Found";

            if (this.IsTextExists(body, searchText) || this.IsTextExists(title, searchText))
            {
                details.SearchResult = "Exists";
            }
            else if (resultCopy.Contains(searchText))
            {
                details.SearchResult = "Exists";
            }
        }
		private void SearchSpecificContent( ResponseDetails details, string searchText )
		{
			var doc = new HtmlDocument();
			doc.LoadHtml( details.SearchResult );

			var body = doc.DocumentNode.SelectNodes( "//body" );
			var title = doc.DocumentNode.SelectNodes( "//title" );
			var resultCopy = details.SearchResult;
			details.SearchResult = "Not Found";

			if( this.IsTextExists( body, searchText ) || this.IsTextExists( title, searchText ) )
			{
				details.SearchResult = "Exists";
			}
			else if( resultCopy.Contains( searchText ) )
			{
				details.SearchResult = "Exists";
			}
		}
		private static void WriteResponseInfo( HttpWebResponse response, ResponseDetails details )
		{
			details.Response = String.Format( "{0}{1}{2}", Convert.ToString( ( int )response.StatusCode ), ' ', response.StatusDescription );

			using( var reader = new StreamReader( response.GetResponseStream(), Encoding.ASCII ) )
			{
				details.SearchResult = reader.ReadToEnd();
			}

			if( ResponseDetails != null )
			{
				ResponseDetails.Add( details );
			}
		}
		public static void ScanResource( object request )
		{
			var values = ( List< object > )request;
			var castedRequest = ( HttpWebRequest )values[ 1 ];
			var details = new ResponseDetails
				{
					Url = castedRequest.RequestUri,
					UserName = ( string )values[ 0 ]
				};

			try
			{
				using( var response = ( HttpWebResponse )castedRequest.GetResponse() )
				{
					foreach( Cookie cookie in response.Cookies )
					{
						_cookieContainer.Add( response.ResponseUri, cookie );
					}

					WriteResponseInfo( response, details );
					response.Close();
				}

			}
			catch( WebException ex )
			{
				WriteResponseInfo( ( HttpWebResponse )ex.Response, details );
			}
		}