![]() |
[WebMethod]
public string Address(int zipcode)
{
PostData pd = PostData.Instance(Server);
ArrayList a = pd.GetTownData(zipcode);
if (a == null) return "無効な番号です";
TownData tw = (TownData)a[0];
CityData ct = tw.Parent;
PrefData pf = ct.Parent;
return pf.Value + ct.Value + tw.Value;
}
private void button1_Click(object sender, System.EventArgs e)
{
WinPostalCode.localhost.Service1 srv = new WinPostalCode.localhost.Service1();
label1.Text = srv.Address(int.Parse(textBox1.Text));
}