using System.Collections.Generic;
const string deltaURLString = @"https://delta-nsk.ru/uploads/6343fmalwUrlw.xml";
const string xmlId = "id";
const string xmlLink = "link";
public static void Main()
XmlDocument doc = new XmlDocument();
doc.Load(deltaURLString);
LogTxt += "Ошибка загрузки файла с сайта: "+ ex.Message +"\n";
var root = doc.GetElementsByTagName("offers")[0];
if (root != null && root.HasChildNodes)
Dictionary<string,string> listAdvertisment = new Dictionary<string,string>();
for (int i = 0; i < root.ChildNodes.Count; i++)
var offer = root.ChildNodes[i];
for (int j = 0; j < offer.ChildNodes.Count; j++)
if (offer.ChildNodes[j].Name == xmlId)
id = offer.ChildNodes[j].InnerText;
if (offer.ChildNodes[j].Name == xmlLink)
link = offer.ChildNodes[j].InnerText;
if (!string.IsNullOrEmpty(id))
listAdvertisment.Add(id, link);
LogTxt += "Загрузка файла с сайта завершена успешно. Найдено ссылок по заявкам: " + offers_count + "\n";
Console.WriteLine(LogTxt);