Click here to Skip to main content
12,406,342 members (67,880 online)
Click here to Skip to main content
Add your own
alternative version

Stats

64.2K views
843 downloads
23 bookmarked
Posted

Currency Convertor

, 30 May 2005 GPL3
Rate this:
Please Sign up or sign in to vote.
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:

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

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, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

Share

About the Author

Priyank Bolia
Software Developer (Senior)
India India
No Biography provided

You may also be interested in...

Comments and Discussions

 
QuestionTry this link https://www.igolder.com/exchangerate.ashx?from=EUR&to=CAD Pin
Jcmorin21-Sep-11 6:04
memberJcmorin21-Sep-11 6:04 
GeneralCode...... Pin
Member 453129811-Jan-10 0:24
memberMember 453129811-Jan-10 0:24 
GeneralRe: Code...... Pin
Priyank Bolia11-Jan-10 0:31
memberPriyank Bolia11-Jan-10 0:31 
GeneralRe: Code...... Pin
Member 453129811-Jan-10 0:33
memberMember 453129811-Jan-10 0:33 
GeneralDidnt work for me :( Pin
adk_amit7-Mar-09 22:59
memberadk_amit7-Mar-09 22:59 
GeneralRe: Didnt work for me :( Pin
Priyank Bolia8-Mar-09 1:11
memberPriyank Bolia8-Mar-09 1:11 
GeneralSource available from Priyank.co.in Pin
Priyank Bolia5-Nov-06 18:09
memberPriyank Bolia5-Nov-06 18:09 
QuestionSource code would help!! Pin
S P S18-Oct-06 8:08
memberS P S18-Oct-06 8:08 
QuestionWhere is the code? Pin
emadns30-May-05 19:15
memberemadns30-May-05 19:15 
AnswerRe: Where is the code? Pin
Ali I.30-May-05 23:19
sussAli I.30-May-05 23:19 
GeneralRe: Where is the code? Pin
Cugel200528-May-06 13:53
memberCugel200528-May-06 13:53 
GeneralRe: Where is the code? Pin
pwesson4-Sep-06 1:59
memberpwesson4-Sep-06 1:59 
GeneralRe: Where is the code? Pin
gkettani23-Aug-10 12:09
membergkettani23-Aug-10 12:09 
GeneralVery UseFul! Pin
ThatsAlok30-May-05 18:25
memberThatsAlok30-May-05 18:25 
GeneralRe: Very UseFul! Pin
Priyank Bolia30-May-05 18:36
memberPriyank Bolia30-May-05 18:36 
GeneralMore than the tool.... Pin
Victor Boctor30-May-05 12:23
memberVictor Boctor30-May-05 12:23 
GeneralNice! Pin
Ravi Bhavnani30-May-05 6:56
memberRavi Bhavnani30-May-05 6:56 
GeneralRe: Nice! Pin
Priyank Bolia30-May-05 20:19
memberPriyank Bolia30-May-05 20:19 
GeneralRe: Nice! Pin
Ravi Bhavnani31-May-05 1:33
memberRavi Bhavnani31-May-05 1:33 
GeneralRe: Nice! Pin
Priyank Bolia31-May-05 2:49
memberPriyank Bolia31-May-05 2:49 
GeneralRe: Nice! Pin
Ravi Bhavnani31-May-05 4:44
memberRavi Bhavnani31-May-05 4:44 
GeneralRe: Nice! Pin
Priyank Bolia31-May-05 18:20
memberPriyank Bolia31-May-05 18:20 
GeneralRe: Nice! Pin
Ravi Bhavnani1-Jun-05 2:32
memberRavi Bhavnani1-Jun-05 2:32 
GeneralRe: Nice! Pin
Priyank Bolia1-Jun-05 4:06
memberPriyank Bolia1-Jun-05 4:06 
GeneralVERY USEFUL Pin
BobbyQSoft30-May-05 6:41
memberBobbyQSoft30-May-05 6:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160730.1 | Last Updated 30 May 2005
Article Copyright 2005 by Priyank Bolia
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid