Category Archives: xml

LINQPad – tcmb.gov.tr günlük kur bilgisi

void Main() { string path = “http://www.tcmb.gov.tr/kurlar/today.xml”; XDocument xDoc = XDocument.Load(path); var tarih = xDoc.Element(“Tarih_Date”).Attribute(“Tarih”).Value; var usd = (from x in xDoc.Descendants(“Currency”) where (string)x.Attribute(“Kod”) == “USD” select x).FirstOrDefault(); usd.Element(“ForexBuying”).Value.Dump(); usd.Element(“ForexSelling”).Value.Dump(); }