Share via


Platform.GetDevices メソッド

更新 : 2007 年 11 月

このプラットフォームに関連付けられているすべてのデバイスのコレクションを取得します。

名前空間 :  Microsoft.SmartDevice.Connectivity
アセンブリ :  Microsoft.SmartDevice.Connectivity (Microsoft.SmartDevice.Connectivity.dll 内)

構文

'宣言
Public Function GetDevices As Collection(Of Device)
'使用
Dim instance As Platform
Dim returnValue As Collection(Of Device)

returnValue = instance.GetDevices()
public Collection<Device> GetDevices()
public:
Collection<Device^>^ GetDevices()
public function GetDevices() : Collection<Device>

戻り値

型 : System.Collections.ObjectModel.Collection<Device>

このプラットフォームに関連付けられているデバイスのコレクションを返します。

' Get datastore object
Dim dsmgr As New DatastoreManager(1033)

' Get the platforms in the Datastore
Dim platforms As Collection(Of Platform) = dsmgr.GetPlatforms()

' For each platform, output name and ID
Dim platform As Platform
For Each platform In platforms
    Console.WriteLine("Platform Name: " & _
                      platform.Name & "    ID: " & platform.Id.ToString())
    Console.WriteLine("    OSVersion: " & platform.GetProperty("OSVersion"))
    Console.WriteLine("    DefaultPlatform: " & _
                      platform.GetProperty("DefaultPlatform"))
    Console.WriteLine("    DefaultDevice: " & platform.GetProperty("DefaultDevice"))
    Console.WriteLine("    ShortName: " & platform.GetProperty("ShortName"))
    Console.WriteLine("    DefaultFormFactor: " & _
                      platform.GetProperty("DefaultFormFactor"))
Next platform
// Get datastore object
DatastoreManager dsmgr = new DatastoreManager(1033);

// Get the platforms in the Datastore
Collection<Platform> platforms = dsmgr.GetPlatforms();

// For each platform, output name, ID, and platform properties.
foreach (Platform platform in platforms)
{
    Console.WriteLine("Platform Name: " + platform.Name + "    ID: " + platform.Id);
    Console.WriteLine("    OSVersion: " + platform.GetProperty("OSVersion"));
    Console.WriteLine("    DefaultPlatform: " + 
        platform.GetProperty("DefaultPlatform"));
    Console.WriteLine("    DefaultDevice: " + platform.GetProperty("DefaultDevice"));
    Console.WriteLine("    ShortName: " + platform.GetProperty("ShortName"));
    Console.WriteLine("    DefaultFormFactor: " + 
        platform.GetProperty("DefaultFormFactor"));
}

アクセス許可

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

Platform クラス

Platform メンバ

Microsoft.SmartDevice.Connectivity 名前空間