1-) C# RMOS - para döviz kur alma
using System;
using System.Windows.Forms;
using System.Xml;
namespace WindowsFormsApp3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public static readonly string eur = "EUR", usd = "USD";
private void button1_Click(object sender, EventArgs e)
{
decimal eur_tl = getKur(eur);
decimal usd_tl = getKur(usd);
Console.WriteLine(eur + " = " + eur_tl + " TL");
Console.WriteLine(usd + " = " + usd_tl + " TL");
}
public decimal getKur(String kurKodu)
{
string exchangeRate = "http://www.tcmb.gov.tr/kurlar/today.xml";
var xmlDoc = new XmlDocument();
xmlDoc.Load(exchangeRate);
decimal doviz = Convert.ToDecimal(xmlDoc.SelectSingleNode("Tarih_Date/Currency [@Kod='" + kurKodu + "']/BanknoteSelling").InnerXml.Replace(".", ","));
return doviz;
}
}
}