货币转换器需要代码 [英] Need Code For The Currency Converter

查看:130
本文介绍了货币转换器需要代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里我需要用于将一种国家/地区的货币转换为另一种国家/地区的货币的代码
例子
1)如果我们以1美元为输入单位,则应该显示为53.45印度卢比.
2)如果我们以1欧元的价格输入欧元,则应该显示为73.45印度卢比.

需要使用C#语言在Asp.net中编写代码
它应该显示当前市场价格的值(我的意思是卢比值可能会每天变化)
在这里我正在使用Web服务此Web服务
http://www.webservicex.net/CurrencyConvertor.asmx?WSDL [

Hi Here I need Code For converting one country currency into another country currency
Example
1)if we give input as Usd 1 Dollar it should display as 53.45 Indian rupees.
2)if we give input as Eur 1 pound it should display as 73.45 Indian rupees.

need code in Asp.net with C# Language
it should display values as per as market in present day (I mean that rupee value may change day by day)
here i am using web Services this web service
http://www.webservicex.net/CurrencyConvertor.asmx?WSDL[^]
can any one tell the procedure how to call this web services in code
i have used this in on form load

(here My web service name is CurrencyConvertor)
{
CurrencyConvertor.Currency Currency = default(CurrencyConvertor.Currency);
System.Array CountryList = default(System.Array);
CountryList = System.Currency.GetType();
//CountryList = Currency.GetValues(Currency.GetType);(here is Error)
Country1list.DataSource = CountryList;
Country1list.DataBind();
Country2list.DataSource = CountryList;
Country2list.DataBind();
}


again in button click(here its give lot of errors)
{
CurrencyConvertor.CurrencyConvertor CurrencyConvertor = new CurrencyConvertor.CurrencyConvertor();
CurrencyConvertor.Currency Currency = new CurrencyConvertor.Currency();
double dt = CurrencyConvertor.ConversionRate(System.Enum.Parse(Currency.GetType(), DropDownListFromCountry.Text), System.Enum.Parse(Currency.GetType(), DropDownListToCountry.Text));
Response.Write(string.Format("Converted Amount {0}", dt * Convert.ToDouble(TextBoxRes.Text.Trim)));
}

推荐答案

此链接可能对您有帮助
http://forums.asp.net/t/1297305.aspx /1 [ ^ ]
This link may help you
http://forums.asp.net/t/1297305.aspx/1[^]


亲爱的朋友,

如果您的Web服务工作完美,则可以通过添加Web引用在项目中调用您的Web服务.然后使用该引用创建一个对象,然后可以调用ur方法.
Dear Friend,

If Your Webservice Work Perfectly Then you can Call your Webservice in your project through add web reference.And Create one Object with that Reference then You can call ur Methods.


检查以下内容:

使用Web服务进行货币转换 [用于获取货币汇率的简单类 [ ^ ]

祝你好运
快乐编码:)
check these out:

Currency Conversion Using Web Services[^]

Simple Class to get Currency Exchange Rates[^]

Best Luck
Happy Coding:)


这篇关于货币转换器需要代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆