Asp.Net Döviz Kuru Çekme
Projemde yarın ihtiyacım olan döviz kuru çekme olayını buldum internette. Bir çok sitede var ama hepsi kopyala+yapıştır olduğu için kaynak belirtmiyorum.
http://www.tcmb.gov.tr/kurlar/today.xml
Xml belgesinden çekiyoruz kuru.
Html Kod:
Arkaplan Kod:
http://www.tcmb.gov.tr/kurlar/today.xml
Xml belgesinden çekiyoruz kuru.
Html Kod:
<table style="width: 100%; height: 75px"><tr><td align="center">Dolar<br /><asp:Label ID="Label3"runat="server"Text=""></asp:Label> TL</td><td align="center">Euro<br /><asp:Label ID="Label4"runat="server"Text=""></asp:Label> TL</td></tr></table>
Arkaplan Kod:
XmlDocument xmlVerisi =newXmlDocument();xmlVerisi.Load("http://www.tcmb.gov.tr/kurlar/today.xml");decimaldolar = Convert.ToDecimal(xmlVerisi.SelectSingleNode(string.Format("Tarih_Date/Currency[@Kod='{0}']/ForexSelling","USD")).InnerText.Replace('.',','));decimalEuro = Convert.ToDecimal(xmlVerisi.SelectSingleNode(string.Format("Tarih_Date/Currency[@Kod='{0}']/ForexSelling","EUR")).InnerText.Replace('.',','));Label3.Text = dolar.ToString();Label4.Text = Euro.ToString();
Yorumlar
Yorum Gönder
İlk Yorumu Siz Yazın...!