Beispiel #1
0
        private void Button_TestFullTag_Click(object sender, RoutedEventArgs e)
        {
            Web_Document doc = new Web_Document("");

            doc.UpdateDocumentWithNewUrl(this.textBox_Url_Test.Text);

            //TAG.Host = "wikidich";
            //this.TextBox_Result.Text = doc.ToString();
            ListHost ls = new ListHost();

            ls.tag.Add(TAG);
            doc.IntListHost(ls);

            doc.DetectHost(this.textBox_Url_Test.Text);

            String data = doc.GetContentInDocument(Web_Document.IndexOfArray_BookName) + Environment.NewLine;

            data += doc.GetContentInDocument(Web_Document.IndexOfArray_ChapName) + Environment.NewLine;
            data += doc.GetContentInDocument(Web_Document.IndexOfArray_ChapContent) + Environment.NewLine;
            data += doc.GetContentInDocument(Web_Document.IndexOfArray_UrlNext) + Environment.NewLine;
            this.TextBox_Result.Text = data;
        }
Beispiel #2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (!Lib.CheckUrl(this.TextBox_UrlCurrent.Text))
            {
                return;
            }

            //Web_Document dc = new Web_Document("hhh");
            //dc.InitBookName(Web_Document.Type_Class, "book-title", Web_Document.Get_With_Index, 0, 0," ", Web_Document.AttType_InnterText);
            //dc.InitChapName(Web_Document.Type_Class, "book-title", Web_Document.Get_With_Index, 1, 0, " ", Web_Document.AttType_InnterText);
            //dc.InitChapContent(Web_Document.Type_Id, "bookContentBody", Web_Document.Get_With_Index, 0, 0, " ", Web_Document.AttType_InnerHtml);
            //dc.InitUrlNext(Web_Document.Type_Class, "btn-bot", Web_Document.Get_With_Value,0,Web_Document.AttType_Style , "margin-left: 0.3rem; display: inline-block; margin-right: 1rem", Web_Document.AttType_Href);

            //dc.UpdateDocumentWithNewUrl(this.TextBox_UrlCurrent.Text);
            //if (dc.CheckInitSite())
            //{
            //    this.TextBox_Result.Text = dc.GetContentInDocument(Web_Document.IndexOfArray_BookName) + Environment.NewLine;
            //    this.TextBox_Result.AppendText(dc.GetContentInDocument(Web_Document.IndexOfArray_ChapName) + Environment.NewLine);
            //    this.TextBox_Result.AppendText(dc.GetContentInDocument(Web_Document.IndexOfArray_ChapContent) + Environment.NewLine);
            //    this.TextBox_Result.AppendText(dc.GetContentInDocument(Web_Document.IndexOfArray_UrlNext) + Environment.NewLine);
            //}
            bool detect = document.DetectHost(this.TextBox_UrlCurrent.Text);

            if (detect)
            {
                document.UpdateDocumentWithNewUrl(this.TextBox_UrlCurrent.Text);
                Console.WriteLine(document.HostStr);
                if (document.CheckInitSite())
                {
                    this.TextBox_Result.Text = document.GetContentInDocument(Web_Document.IndexOfArray_BookName) + Environment.NewLine;
                    this.TextBox_Result.AppendText(document.GetContentInDocument(Web_Document.IndexOfArray_ChapName) + Environment.NewLine);
                    this.TextBox_Result.AppendText(document.GetContentInDocument(Web_Document.IndexOfArray_ChapContent) + Environment.NewLine);
                    this.TextBox_Result.AppendText(document.GetContentInDocument(Web_Document.IndexOfArray_UrlNext) + Environment.NewLine);
                }
            }
        }
Beispiel #3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            HostTag TAG = new HostTag();

            int    index = (this.comboBox_Tag.SelectedItem as ItemComboBox).Value;
            String test  = (this.comboBox_Tag.SelectedItem.ToString());

            TAG = GetHostFromForm();

            test += "  " + (this.comboBox_Type.SelectedItem as ItemComboBox).Value;
            test += "  \"" + this.TextBox_Name.Text + "\"";
            test += "  " + (this.comboBox_TypeToGet.SelectedItem as ItemComboBox).Value;
            test += "  " + Int16.Parse(this.textBox_Index.Text);
            test += "  " + (this.comboBox_Att_Type_Compare.SelectedItem as ItemComboBox).Value;
            test += "  \"" + this.textBox_StrToCompare.Text + "\"";
            test += "  " + (this.comboBox_Att_Type_Get.SelectedItem as ItemComboBox).Value;



            Web_Document doc = new Web_Document("");

            doc.UpdateDocumentWithNewUrl(this.textBox_Url_Test.Text);

            //TAG.Host = "wikidich";
            //this.TextBox_Result.Text = doc.ToString();
            ListHost ls = new ListHost();

            ls.tag.Add(TAG);
            doc.IntListHost(ls);

            doc.DetectHost(this.textBox_Url_Test.Text);

            String data = doc.GetContentInDocument((Int16)index);

            this.TextBox_Result.Text = data;

            this.TextBox_Result.Text += Environment.NewLine + test;
        }