Click here to Skip to main content
Licence GPL3
First Posted 30 May 2005
Views 45,578
Bookmarked 21 times

Currency Convertor

By | 30 May 2005 | Article
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)

About the Author

Priyank Bolia

Software Developer (Senior)

India India

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionTry this link https://www.igolder.com/exchangerate.ashx?from=EUR&to=CAD PinmemberJcmorin6:04 21 Sep '11  
GeneralCode...... PinmemberMember 45312980:24 11 Jan '10  
GeneralRe: Code...... PinmemberPriyank Bolia0:31 11 Jan '10  
GeneralRe: Code...... PinmemberMember 45312980:33 11 Jan '10  
GeneralDidnt work for me :( Pinmemberadk_amit22:59 7 Mar '09  
GeneralRe: Didnt work for me :( PinmemberPriyank Bolia1:11 8 Mar '09  
GeneralSource available from Priyank.co.in PinmemberPriyank Bolia18:09 5 Nov '06  
QuestionSource code would help!! PinmemberS P S8:08 18 Oct '06  
QuestionWhere is the code? Pinmemberemadns19:15 30 May '05  
AnswerRe: Where is the code? PinsussAli I.23:19 30 May '05  
GeneralRe: Where is the code? PinmemberCugel200513:53 28 May '06  
GeneralRe: Where is the code? Pinmemberpwesson1:59 4 Sep '06  
GeneralRe: Where is the code? Pinmembergkettani12:09 23 Aug '10  
GeneralVery UseFul! PinmemberThatsAlok18:25 30 May '05  
GeneralRe: Very UseFul! PinmemberPriyank Bolia18:36 30 May '05  
GeneralMore than the tool.... PinmemberVictor Boctor12:23 30 May '05  
GeneralNice! PinmemberRavi Bhavnani6:56 30 May '05  
GeneralRe: Nice! PinmemberPriyank Bolia20:19 30 May '05  
GeneralRe: Nice! PinmemberRavi Bhavnani1:33 31 May '05  
GeneralRe: Nice! PinmemberPriyank Bolia2:49 31 May '05  
GeneralRe: Nice! PinmemberRavi Bhavnani4:44 31 May '05  
GeneralRe: Nice! PinmemberPriyank Bolia18:20 31 May '05  
GeneralRe: Nice! PinmemberRavi Bhavnani2:32 1 Jun '05  
GeneralRe: Nice! PinmemberPriyank Bolia4:06 1 Jun '05  
GeneralVERY USEFUL PinmemberBobbyQSoft6:41 30 May '05  

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

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

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