private void BtnShowHTMLContent_Click(object sender, RoutedEventArgs e)
        {
            var browser = new MsHtmlBrowser();
            browser.GoTo(this.CombxHTMLfilenames.SelectedItem.ToString());
            if (browser.Text.ToString() == null)
            {
                txtbxShowhtmlcontent.Text = "n/a";
            }
            else
            {
                txtbxShowhtmlcontent.Text = browser.Text.ToString();
                string PlainHTML = txtbxShowhtmlcontent.Text.ToString();
                RecordData.ShownHTMLPlainTextContent = PlainHTML;
            }
            RecordData.firstanalyzeFlg = true;
            System.Windows.MessageBox.Show("HTML Content Shown Sucessfully ", "Scraper Demo", MessageBoxButton.OK, MessageBoxImage.Information);

        }
Пример #2
0
        private void ShowDiff_Click(object sender, RoutedEventArgs e)
        {
            if (RecordData.mainRecords.web1URL == null || RecordData.mainRecords.web1URL == "")
            {
                System.Windows.MessageBox.Show("Analyze The URL First", "Scraper Demo", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }

            if (RecordData.mainRecords.web2URL == null || RecordData.mainRecords.web1URL == "")
            {
                System.Windows.MessageBox.Show("Analyze The URL First", "Scraper Demo", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }

            try
            {
                string strFirst = "";
                string strSecond = "";

                var browserFirst = new MsHtmlBrowser();

                Task t1 = Task.Run(() =>
                {
                    browserFirst.GoTo(RecordData.mainRecords.web1URL);
                    strFirst = browserFirst.Text.ToString();
                });
                t1.Wait();

                var browserSecond = new MsHtmlBrowser();

                Task t2 = Task.Run(() =>
                {
                    browserFirst.GoTo(RecordData.mainRecords.web2URL);
                    strSecond = browserFirst.Text.ToString();
                });
                t2.Wait();

                Task t3 = Task.Run(() =>
                {
                    System.IO.FileInfo file = new System.IO.FileInfo(@"C:\Scrpaer\");
                    file.Directory.Create();                    
                    System.IO.File.WriteAllText(@"C:\Scrpaer\First.txt", strFirst);
                    System.IO.File.WriteAllText(@"C:\Scrpaer\Second.txt", strSecond);
                });
                t3.Wait();             

                DiffCalc.MainForm openDiff = new MainForm();
                openDiff.ShowDialog();

                
            }
            catch
            {
                System.Windows.MessageBox.Show("Analyze The URL First", "Scraper Demo", MessageBoxButton.OK, MessageBoxImage.Information);
            }
           
        }
Пример #3
0
        private void BtnwebpagecontentDiff_Click(object sender, RoutedEventArgs e)
        {

            Uri uriResult;
            bool resultfirst = Uri.TryCreate(txtbxfirsturl.Text.ToString(), UriKind.Absolute, out uriResult) && uriResult.Scheme == Uri.UriSchemeHttp;
            bool resultsecond = Uri.TryCreate(txtbxsecondurl.Text.ToString(), UriKind.Absolute, out uriResult) && uriResult.Scheme == Uri.UriSchemeHttp;
            if (!resultfirst)
            {
                MessageBox.Show("Enter first URL", "Scrapper Demo", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }
            if (!resultsecond)
            {
                MessageBox.Show("Enter second URL", "Scrapper Demo", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }

            RecordData.mainRecords.web1URL = txtbxfirsturl.Text;
            RecordData.mainRecords.web2URL = txtbxsecondurl.Text;

            if (RecordData.mainRecords.web1URL == null || RecordData.mainRecords.web1URL == "")
            {
                System.Windows.MessageBox.Show("Analyze The URL First", "Scraper Demo", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }

            if (RecordData.mainRecords.web2URL == null || RecordData.mainRecords.web1URL == "")
            {
                System.Windows.MessageBox.Show("Analyze The URL First", "Scraper Demo", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }


            try
            {
                string strFirst = "";
                string strSecond = "";

                MsHtmlBrowser browserFirst = new MsHtmlBrowser();

                Task t1 = Task.Run(() =>
                {
                    browserFirst.GoTo(RecordData.mainRecords.web1URL);
                    strFirst = browserFirst.Text.ToString();
                });
                t1.Wait();

                MsHtmlBrowser browserSecond = new MsHtmlBrowser();

                Task t2 = Task.Run(() =>
                {
                    browserSecond.GoTo(RecordData.mainRecords.web2URL);
                    strSecond = browserSecond.Text.ToString();
                });
                t2.Wait();

                Task t3 = Task.Run(() =>
                {
                    System.IO.FileInfo file = new System.IO.FileInfo(@"C:\Scrpaer\");
                    file.Directory.Create();
                    System.IO.File.WriteAllText(@"C:\Scrpaer\First.txt", strFirst);
                    System.IO.File.WriteAllText(@"C:\Scrpaer\Second.txt", strSecond);
                });
                t3.Wait();

                DiffCalc.MainForm openDiff = new DiffCalc.MainForm();
                openDiff.ShowDialog();


            }
            catch
            {
                System.Windows.MessageBox.Show("Analyze The URL", "Scraper Demo", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Пример #4
0
 protected void btnWebSiteText_Click(object sender, EventArgs e)
 {
     var browser = new MsHtmlBrowser();
     browser.GoTo(commandLog.Text);
     commandLog.Text = browser.Text;
 }
Пример #5
0
        //private async Task methodcall(string p1, string p2)
        //{

        //   await Task.Run(() => AtaTimeAnalyzefirst.FirstAnalyzed(txtbxfirsturl.Text, folderpathfirst));
        //   await Task.Run(() => AtaTimeAnalyzeSecond.SecondAnalyzed(txtbxsecondurl.Text, folderpathsecond));         
        //}

        private void Btnwebpagecontentloadtodatabase_Click(object sender, RoutedEventArgs e)
        {
            var browser = new MsHtmlBrowser();
            browser.GoTo(@"E:\ScrapperDemo\index.html");


           string str =  browser.Text.ToString();
          


        }