PowerTools InputMan for Windows Forms 8.0J
GetZipCode(String,String,String) メソッド
使用例 

都道府県の名前(漢字)を示す System.String 値。都道府県名は完全に一致する必要があります。
市区町村の名前(漢字)を示す System.String 値。市区町村名は完全に一致する必要があります。
町域の名前(漢字)を示す System.String 値。町域名は前方一致検索されます。
指定した都道府県名、市区町村名、および町域名を持つ住所レコードを検索します。
構文
Public Overloads Function GetZipCode( _
   ByVal prefectureName As String, _
   ByVal cityName As String, _
   ByVal townName As String _
) As IEnumerable(Of AddressInfo)

パラメータ

prefectureName
都道府県の名前(漢字)を示す System.String 値。都道府県名は完全に一致する必要があります。
cityName
市区町村の名前(漢字)を示す System.String 値。市区町村名は完全に一致する必要があります。
townName
町域の名前(漢字)を示す System.String 値。町域名は前方一致検索されます。

戻り値の型

指定した条件に一致するすべての住所を示す AddressInfo コレクション。
解説
検索が失敗した場合は空のコレクションが返されます。このメソッドは、住所の郵便番号データ内を検索します。
使用例
//  Please use the following namespace
//  using System.Windows.Forms;
//  using GrapeCity.Win.Editors;

public void QueryZipCodeFromAddress()
{
    // Creates instance of GcAddress component.
    GcAddress gcAddress1 = new GcAddress();

    // The following two methods are used for simply query the general ZipCode Data.
    // Query ZipCode with specified prefecture name, city name and town name
    System.Console.WriteLine(gcAddress1.GetZipCode("宮城県", "仙台市泉区", "紫山"));

    // Query ZipCode with full address string.
    System.Console.WriteLine(gcAddress1.GetZipCode("宮城県 仙台市泉区 紫山 3-1-4"));

    // The following two methods are used for query data form specified source.
    System.Console.WriteLine(gcAddress1.GetZipCode("宮城県", "仙台市泉区", "泉中央", ZipCodeQueryMode.CompanyZipCode));
    // Output will include both address records in general postal data base and the company address data base.
    // "9813133,宮城県,仙台市泉区,泉中央,ミヤギケン,センダイシイズミク,イズミチユウオウ"
    // "9813189,宮城県,仙台市泉区,泉中央,2丁目1-1,泉区役所,イズミクヤクシヨ,大口事業所,泉"
    System.Console.WriteLine(gcAddress1.GetZipCode("宮城県仙台市泉区泉中央二丁目1番地の1", ZipCodeQueryMode.GeneralZipCode));
    // Output:
    // "9813133,宮城県,仙台市泉区,泉中央,ミヤギケン,センダイシイズミク,イズミチユウオウ"
}
'  Please use the following namespace
'  using System.Windows.Forms;
'  using GrapeCity.Win.Editors;

Public Sub QueryZipCodeFromAddress()
    ' Creates instance of GcAddress component.
    Dim gcAddress1 As New GcAddress()

    ' The following two methods are used for simply query the general ZipCode Data.
    ' Query ZipCode with specified prefecture name, city name and town name
    System.Console.WriteLine(gcAddress1.GetZipCode("宮城県", "仙台市泉区", "紫山"))

    ' Query ZipCode with full address string.
    System.Console.WriteLine(gcAddress1.GetZipCode("宮城県 仙台市泉区 紫山 3-1-4"))

    ' The following two methods are used for query data form specified source.
    System.Console.WriteLine(gcAddress1.GetZipCode("宮城県", "仙台市泉区", "泉中央", ZipCodeQueryMode.CompanyZipCode))
    ' Output will include both address records in general postal data base and the company address data base.
    ' "9813133,宮城県,仙台市泉区,泉中央,ミヤギケン,センダイシイズミク,イズミチユウオウ"
    ' "9813189,宮城県,仙台市泉区,泉中央,2丁目1-1,泉区役所,イズミクヤクシヨ,大口事業所,泉"
    System.Console.WriteLine(gcAddress1.GetZipCode("宮城県仙台市泉区泉中央二丁目1番地の1", ZipCodeQueryMode.GeneralZipCode))
    ' Output:
    ' "9813133,宮城県,仙台市泉区,泉中央,ミヤギケン,センダイシイズミク,イズミチユウオウ"
End Sub
参照

GcAddress クラス
GcAddress メンバ
オーバーロード一覧

 

 


© 2004-2015 GrapeCity inc. All rights reserved.