protected void spider_theverge_com_Click(object sender, EventArgs e) { try { Spiders spider = new Spiders(); Global_collection collection_news = new Global_collection(); collection_news.add(spider.theverge_com()); var list = collection_news.get(); text = ""; foreach (var element in list) { //Debug.WriteLine("element.type); text += "id = " + element.id.ToString() + "\n"; text += "type = " + element.type + "\n"; text += "sourse = " + element.source + "\n"; text += "title = " + element.title + "\n"; text += "content = " + element.content + "\n"; text += "image = " + element.image + "\n"; text += "\n"; Debug.WriteLine(text); } Output_new.Text = text; update(); Label.Text = "Робота бота завершена."; } catch (Exception ex) { Label.Text = "Вызвано исключение: " + ex.Message; } }
protected void ReadXml_Click(object sender, EventArgs e) { Global_collection collection_news = new Global_collection(); collection_news.readXml(); var list = collection_news.get(); text = ""; foreach (var element in list) { //Debug.WriteLine("element.type); text += "id = " + element.id.ToString() + "\n"; text += "type = " + element.type + "\n"; text += "sourse = " + element.source + "\n"; text += "title = " + element.title + "\n"; text += "content = " + element.content + "\n"; text += "image = " + element.image + "\n"; text += "\n"; Debug.WriteLine(text); } Output_new.Text = text; update(); }