如何在您的Asp.net应用程序中获得最新的货币汇率 [英] How to get the Latest Currency Exchange Rate in your Asp.net Application
问题描述
大家好
如何在Asp.net应用程序中获取最新货币汇率。是否有任何内置从网上获取最新汇率的API。
要求:
要求是我有印度卢比的一个计算值,从下拉列表中选择的货币值应该更改。
例如,如果我从下拉列表中选择美元,则计算值应转换为美元。
为此,我想使用一些WebService从网上获取最新的汇率。
我想调用的下拉列表的OnselectedIndexchange事件用于获取不同世界货币数据的Web服务。
Hi All
How to get the Latest Currency Exchange Rate in your Asp.net Application.Is there any build-in API for getting the latest exchange rates from the web.
Requirement:
The Requirement is i have one calculated value in Indian Rupee, on selected Currency from a dropdownlist the value should change.
For example if i select USD from dropdownlist the Calculated value should converted to USD.
For this i want to use some WebService to get the latest Exchange Rates from the Web.
OnselectedIndexchange event of dropdownlist i want to call the webservice to get data for different World Currencies.
推荐答案
https://openexchangerates.org / documentation [ ^ ]
大家好我得到了上述问题的解决方案。
转到http://webservicex.net,这是为ExchangeRate提供WebService
以下是我所做的代码。
在客户端应用程序中添加服务参考
http://www.webservicex.net/CurrencyConvertor.asmx
然后在客户端应用程序中创建代理对象
Hi Everyone i got the solution for the above Question.
GO to http://webservicex.net, this is providing a WebService for ExchangeRate
Here is the code what i did.
Add service Reference in your Client Application
http://www.webservicex.net/CurrencyConvertor.asmx
Then Create the proxy Object in your Client Application
CurrencyExchange.CurrencyConvertor exchangerate = new CurrencyExchange.CurrencyConvertor();
double exchangevalue;
if (DropDownListcurrencies.SelectedValue == "UAE Dhiram")
{
exchangevalue = exchangerate.ConversionRate(CurrencyExchange.Currency.INR,CurrencyExchange.Currency.AED);
resultuae = result * Convert.ToDecimal(exchangevalue);
}
这篇关于如何在您的Asp.net应用程序中获得最新的货币汇率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!