Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fetch currency rate in C# Winform

Tags:

c#

winforms

I have a very simple sounding winform task in my book. Using windows form. Fetch the latest currency rate in the text box.

1 USD = ??? INR

best solution to display converted currency I thought was to use Process method with a query string...

http://www.xe.com/ucc/convert.cgi?Amount=" + costTextBox.Text.ToString() + "&From=USD&To=INR"

But how to get and separate the value into the text box?

like image 965
gsvirdi Avatar asked Sep 28 '26 02:09

gsvirdi


1 Answers

Instead of trying to scrap the value from the response from xe.com i would suggest to either purchase their services from here or use this free webservice

  1. Add the wsdl as a service reference.
  2. Create the SoapClient
  3. Call the ConversionRate method.

var result = client.ConversionRate(CurrencyConverterService.Currency.USD,
                                   CurrencyConverterService.Currency.INR);
like image 188
NoviceProgrammer Avatar answered Sep 30 '26 16:09

NoviceProgrammer