Daha önceki "Web Sitemiz .." başlıklı bir kaç yazımda Web Part' lar hazırlamıştım.
Yeni bir kontrol daha; Tcmb günlük döviz bilgileri.
Uygulamayı indirmek için tıklayın.
Kullanım kolaylığı için 2 adet özellik eklendi. 
public static string[] dovizBilgisi(DovizTipleri tip)
{
if (HttpContext.Current.Cache[tip.ToString()] == null)
{
XmlDocument xDoc = new XmlDocument();
//local -> test
xDoc.Load(HttpContext.Current.Server.MapPath("App_Data/doviz.xml"));
//online -> application
//xDoc.Load("http://www.tcmb.gov.tr/kurlar/today.xml");
string[] doviz = {
xDoc.SelectSingleNode(string.Format(
"Tarih_Date/Currency[@Kod='{0}']/ForexBuying",
tip.ToString())).InnerText.Replace('.', ','),
xDoc.SelectSingleNode(string.Format(
"Tarih_Date/Currency[@Kod='{0}']/ForexSelling",
tip.ToString())).InnerText.Replace('.', ',')
};
HttpContext.Current.Cache.Insert(
tip.ToString(),
doviz,
null,
DateTime.Now.AddHours(2),
TimeSpan.Zero);
}
return (string[])HttpContext.Current.Cache[tip.ToString()];
}
