Asp ile güncel döviz kurlarını almak çok basittir. Aşağıdaki fonksiyon ile döviz kurlarını sayfamızda istediğimiz yere yazdırabiliriz.
<% ' Güncel döviz bilgisi
Set kurlar = Server.CreateObject("msxml2.DOMDocument" )
kurlar.async = false
kurlar.resolveExternals = false
kurlar.setProperty "ServerHTTPRequest" ,true
kurlar.load("http://www.tcmb.gov.tr/kurlar/today.xml" )
Set sonuc =kurlar.getElementsByTagName("Currency" )
USDA=sonuc.item(0).childnodes.item(3).nodeTypedValue
USDS=sonuc.item(0).childnodes.item(4).nodeTypedValue
EURA=sonuc.item(3).childnodes.item(3).nodeTypedValue
EURS=sonuc.item(3).childnodes.item(4).nodeTypedValue
Function EditCurrency(strCurrency)
EditCurrency = Replace(strCurrency, "." , "," , 1, -1, 1)
End Function %>
Yukarıdaki kod ile Merkez Bankasının sitesinden döviz kurlarını aldık.