Form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MyCurrency
{
public partial class Form1 : Form
{
enum Currency
{
AFA,
ALL,
DZD,
ARS,
AWG,
AUD,
BSD,
BHD,
BDT,
BBD,
BZD,
BMD,
BTN,
BOB,
BWP,
BRL,
GBP,
BND,
BIF,
XOF,
XAF,
KHR,
CAD,
CVE,
KYD,
CLP,
CNY,
COP,
KMF,
CRC,
HRK,
CUP,
CYP,
CZK,
DKK,
DJF,
DOP,
XCD,
EGP,
SVC,
EEK,
ETB,
EUR,
FKP,
GMD,
GHC,
GIP,
XAU,
GTQ,
GNF,
GYD,
HTG,
HNL,
HKD,
HUF,
ISK,
INR,
IDR,
IQD,
ILS,
JMD,
JPY,
JOD,
KZT,
KES,
KRW,
KWD,
LAK,
LVL,
LBP,
LSL,
LRD,
LYD,
LTL,
MOP,
MKD,
MGF,
MWK,
MYR,
MVR,
MTL,
MRO,
MUR,
MXN,
MDL,
MNT,
MAD,
MZM,
MMK,
NAD,
NPR,
ANG,
NZD,
NIO,
NGN,
KPW,
NOK,
OMR,
XPF,
PKR,
XPD,
PAB,
PGK,
PYG,
PEN,
PHP,
XPT,
PLN,
QAR,
ROL,
RUB,
WST,
STD,
SAR,
SCR,
SLL,
XAG,
SGD,
SKK,
SIT,
SBD,
SOS,
ZAR,
LKR,
SHP,
SDD,
SRG,
SZL,
SEK,
CHF,
SYP,
TWD,
TZS,
THB,
TOP,
TTD,
TND,
TRL,
USD,
AED,
UGX,
UAH,
UYU,
VUV,
VEB,
VND,
YER,
YUM,
ZMK,
ZWD,
TRY
}
public Form1()
{
InitializeComponent();
foreach (var item in Enum.GetValues(typeof(Currency)))
{
combohave.Items.Add(item);
combowant.Items.Add(item);
}
combohave.Sorted = true;
combowant.Sorted = true;
}
private void label2_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
CurrencyServiceReference.CurrencyConvertorSoapClient currencyConvert = new CurrencyServiceReference.CurrencyConvertorSoapClient("CurrencyConvertorSoap12");
CurrencyServiceReference.Currency cfrom=(CurrencyServiceReference.Currency)combohave.SelectedItem;
CurrencyServiceReference.Currency cto=(CurrencyServiceReference.Currency)combowant.SelectedItem;
double rate = currencyConvert.ConversionRate(cfrom, cto);
txtto.Text = (Convert.ToDouble(txtfrom.Text) * rate).ToString();
}
}
}