Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Currency Convertor

0.00/5 (No votes)
30 May 2005 1  
Converts one currency into another using Yahoo finance exchange rates.

Sample Image - CurrencyConvert.jpg

Introduction

This is a simple tool, that checks the yahoo website for the latest currency rates and converts the given currency into another. It downloads the required exchange rate only when needed and save it for further calculations. So, it saves round way trip again and again to the yahoo website. You can also clear all the downloaded exchange rates. It also shows the latest stock market report. It also automatically checks for any new version available at http://www.priyank.in/ for download, and reports user about the same.

How it works

Actually its internal working is very complex, we have to download the page from yahoo website using HttpWebRequest and HttpWebResponse and apply regular expression to the data, fetch the currency rates, using Regex class' Match function. See, how hard it is, download the page with URL like:


http://finance.yahoo.com/currency/convert?amt=1&from=USD&to=INR&submit=Convert

Replace USD and INR with your currency symbols used by yahoo website and apply a regular expression like:

</td><td\sclass=\"yfnc_tabledata1\">.*?</td><td\sclass=\"yfnc_tabledata1\">
       (.*?)</td><td\sclass=\"yfnc_tabledata1\">

to fetch the data out of the web page. Now, you are able to find out how hard was that.

Sites used for getting exchange rates

Sites used for getting stock market report

.NET Framework

The .NET Framework can be downloaded from the Microsoft website

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here