Exemplo n.º 1
0
        private void AnalyseUrlHandler()
        {
            var    client         = new WebClient();
            string downloadString = client.DownloadString(tbInput.Text.Trim());

            //Get number of occurrences on the page of each word listed in meta tags
            var getNumberOfMetaTagOccurrence = ProcessInput.GetNumberOfMetatagOccurrence(downloadString);

            gvOccurrenceMetaTagResults.DataSource = getNumberOfMetaTagOccurrence;
            gvOccurrenceMetaTagResults.DataBind();

            ViewState["dsmetatagoccurrencepage"]     = getNumberOfMetaTagOccurrence;
            ViewState["sortdsmetatagoccurrencepage"] = "Asc";

            //Get number of occurrences on the page of each word
            var getNumberOfOccurrenceOnPage = ProcessInput.GetNumberOfOccurrencePage(ProcessInput.ConvertHtmlToString(downloadString));

            gvOccurrenceWordResults.DataSource = getNumberOfOccurrenceOnPage;
            gvOccurrenceWordResults.DataBind();

            ViewState["dsnumberofoccurrencepage"]     = getNumberOfOccurrenceOnPage;
            ViewState["sortdsnumberofoccurrencepage"] = "Asc";

            //Get number of external links in the page
            var lExternalLinks = ProcessInput.GetExternalLinkList(downloadString);

            lblTotalExternalLinks.Text = lExternalLinks.Sum(x => x.OccurrenceCount).ToString();

            gvExternalLinksResults.DataSource = lExternalLinks;
            gvExternalLinksResults.DataBind();

            ViewState["dsexternallinkpage"]     = lExternalLinks;
            ViewState["sortdsexternallinkpage"] = "Asc";
        }
Exemplo n.º 2
0
        private void AnalyseEnglishHandler()
        {
            //Get number of occurrences on the page of each word
            var getNumberOfOccurrenceOnText = ProcessInput.GetNumberOfOccurrencePage(tbInput.Text.Trim());

            gvOccurrenceWordResults.DataSource = getNumberOfOccurrenceOnText;
            gvOccurrenceWordResults.DataBind();

            ViewState["dsnumberofoccurrencepage"]     = getNumberOfOccurrenceOnText;
            ViewState["sortdsnumberofoccurrencepage"] = "Asc";

            //Get number of external links in the text
            var lExternalLinks = ProcessInput.GetExternalLinkList(tbInput.Text.Trim());

            lblTotalExternalLinks.Text = lExternalLinks.Sum(x => x.OccurrenceCount).ToString();

            gvExternalLinksResults.DataSource = lExternalLinks;
            gvExternalLinksResults.DataBind();

            ViewState["dsexternallinkpage"]     = lExternalLinks;
            ViewState["sortdsexternallinkpage"] = "Asc";

            gvOccurrenceMetaTagResults.DataSource = null;
            gvOccurrenceMetaTagResults.DataBind();
        }