StringGetWebPage() 공개 메소드

public StringGetWebPage ( ) : string
리턴 string
        private void ValidateRequest(CreateWebrequest webRequest)
        {
            bool succeeded = false;

            try
            {
                string HTML = webRequest.StringGetWebPage();
                if (successFilter.Condition == Filter.Conditions.HTMLContains)
                {
                    succeeded = HTML.Contains(successFilter.Text);
                }
                else if (successFilter.Condition == Filter.Conditions.HTMLContainsNot)
                {
                    succeeded = !HTML.Contains(successFilter.Text);
                }
                else if (successFilter.Condition == Filter.Conditions.RegularExpression)
                {
                    Regex regex = new Regex(successFilter.Text);
                    Match match = regex.Match(HTML);
                    succeeded = match.Success;
                }

                if (webRequest.Response != null)
                {
                    if (successFilter.Condition == Filter.Conditions.StatusCodeIs)
                    {
                        succeeded = ((int)webRequest.Response.StatusCode == Convert.ToInt32(successFilter.Text));
                    }
                    else if (successFilter.Condition == Filter.Conditions.StatusCodeIsNot)
                    {
                        succeeded = ((int)webRequest.Response.StatusCode != Convert.ToInt32(successFilter.Text));
                    }
                }
            }
            catch (Exception)
            {
            }

            if (succeeded)
            {
                ValidCombination validCombination = new ValidCombination();
                validCombination.Username = webRequest.BasicUser;
                validCombination.Password = webRequest.BasicPass;
                validCombinations.Add(validCombination);
            }
        }
        private void ValidateRequest(CreateWebrequest webRequest)
        {
            bool succeeded = false;
            try
            {
                string HTML = webRequest.StringGetWebPage();
                if (successFilter.Condition == Filter.Conditions.HTMLContains)
                    succeeded = HTML.Contains(successFilter.Text);
                else if (successFilter.Condition == Filter.Conditions.HTMLContainsNot)
                    succeeded = !HTML.Contains(successFilter.Text);
                else if (successFilter.Condition == Filter.Conditions.RegularExpression)
                {
                    Regex regex = new Regex(successFilter.Text);
                    Match match = regex.Match(HTML);
                    succeeded = match.Success;
                }

                if (webRequest.Response != null)
                {
                    if (successFilter.Condition == Filter.Conditions.StatusCodeIs)
                        succeeded = ((int)webRequest.Response.StatusCode == Convert.ToInt32(successFilter.Text));
                    else if (successFilter.Condition == Filter.Conditions.StatusCodeIsNot)
                        succeeded = ((int)webRequest.Response.StatusCode != Convert.ToInt32(successFilter.Text));
                }
            }
            catch (Exception)
            {
            }

            if (succeeded)
            {
                ValidCombination validCombination = new ValidCombination();
                validCombination.Username = webRequest.BasicUser;
                validCombination.Password = webRequest.BasicPass;
                validCombinations.Add(validCombination);
            }
        }