PowerTools InputMan for Windows Forms 8.0J
GetPrefectureByJISCode メソッド
使用例 

都道府県コードを示す 2 桁の数字 System.String 値。
全国地方公共団体コードによって都道府県の情報を取得します。
構文
Public Function GetPrefectureByJISCode( _
   ByVal prefectureCode As String _
) As RegionInfo
public RegionInfo GetPrefectureByJISCode( 
   string prefectureCode
)

パラメータ

prefectureCode
都道府県コードを示す 2 桁の数字 System.String 値。

戻り値の型

都道府県の情報を含む RegionInfo オブジェクト。
使用例
//  Please use the following namespace
//  using System.Windows.Forms;
//  using GrapeCity.Win.Editors;

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

    RegionInfo prefectureRegion = gcAddress1.GetPrefectureByJISCode("04");

    // Output:
    // "04,宮城県,ミヤギケン"
    System.Console.WriteLine(prefectureRegion);

    IEnumerable<RegionInfo> cityRegions = gcAddress1.GetCityByJISCode("04");
    // You will see a list of the cities in 宮城県
    foreach (var city in cityRegions)
    {
        System.Console.WriteLine(city);
    }

    cityRegions = gcAddress1.GetCityByJISCode("0415");
    // Output:
    // "04105,宮城県仙台市泉区,ミヤギケンセンダイシイズミク"
    foreach (var city in cityRegions)
    {
        System.Console.WriteLine(city);
    }
}
'  Please use the following namespace
'  using System.Windows.Forms;
'  using GrapeCity.Win.Editors;

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

    Dim prefectureRegion As RegionInfo = gcAddress1.GetPrefectureByJISCode("04")

    ' Output:
    ' "04,宮城県,ミヤギケン"
    System.Console.WriteLine(prefectureRegion)

    Dim cityRegions As IEnumerable(Of RegionInfo) = gcAddress1.GetCityByJISCode("04")
    ' You will see a list of the cities in 宮城県
    For Each city As RegionInfo In cityRegions
        System.Console.WriteLine(city)
    Next

    cityRegions = gcAddress1.GetCityByJISCode("0415")
    ' Output:
    ' "04105,宮城県仙台市泉区,ミヤギケンセンダイシイズミク"
    For Each city As RegionInfo In cityRegions
        System.Console.WriteLine(city)
    Next
End Sub
参照

GcAddress クラス
GcAddress メンバ

 

 


© 2004-2015 GrapeCity inc. All rights reserved.