예제 #1
0
        public void timeTickMonitorWebSite()
        {
            if (CheckBox.Checked)
            {
                try
                {
                    HtmlAgilityPack.HtmlWeb website = new HtmlAgilityPack.HtmlWeb();
                    NewDocument = website.Load(URL);
                }
                catch (IOException)
                {
                }
                catch (WebException)
                {
                }

                KontrolHaberler.Clear();
                if (NewDocument != null)
                {
                    sonDakikaListesiniAl(NewDocument, KontrolHaberler);
                }

                karşılaştır(YüklenenHaberler, KontrolHaberler);
                eskiHaberleriTemizle(YüklenenHaberler, KontrolHaberler);
            }
        }
예제 #2
0
        // Diğer metodlar
        public void monitorWebSite()
        {
            if (CheckBox.Checked && XMLilkYükleme == false)
            {
                try
                {
                    HtmlAgilityPack.HtmlWeb website = new HtmlAgilityPack.HtmlWeb();
                    Document = website.Load(URL);
                }
                catch (IOException)
                {
                }
                catch (WebException)
                {
                }

                YüklenenHaberler.Clear();
                KontrolHaberler.Clear();

                if (Document != null)
                {
                    sonDakikaListesiniAl(Document, YüklenenHaberler);
                }

                if (YüklenenHaberler.Count > Form.max)
                {
                    Form.max = YüklenenHaberler.Count;
                }

                if (yüklenenHaberler.Count > 0)
                {
                    XmlElement root     = Form.xmlDoc.DocumentElement; // xml'in root'u alındı.
                    XmlElement kategori = Form.xmlDoc.CreateElement(XmlBaşlığı);
                    root.AppendChild(kategori);                        // root'a kategori eklendi.
                }
            }
        }