共用方式為


DatastoreManager.GetPlatforms 方法

更新:2007 年 11 月

取得已於資料存放區註冊的所有平台集合。

命名空間:  Microsoft.SmartDevice.Connectivity
組件:  Microsoft.SmartDevice.Connectivity (在 Microsoft.SmartDevice.Connectivity.dll 中)

語法

Public Function GetPlatforms As Collection(Of Platform)

Dim instance As DatastoreManager
Dim returnValue As Collection(Of Platform)

returnValue = instance.GetPlatforms()
public Collection<Platform> GetPlatforms()
public:
Collection<Platform^>^ GetPlatforms()
public function GetPlatforms() : Collection<Platform>

傳回值

型別:System.Collections.ObjectModel.Collection<Platform>

所有平台的 Collection<T>

範例

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

' For each platform, output name and ID
Console.WriteLine("Get all platforms with the GetPlatforms method: " + vbCr + vbLf)
Dim platform As Platform
For Each platform In platforms
    Console.WriteLine("Platform Name: " + platform.Name + "    ID: " + _
                      platform.Id.ToString())
Next platform
// Get the platforms in the Datastore
Collection<Platform> platforms = dsmgr.GetPlatforms();


// For each platform, output name and ID
Console.WriteLine("Get all platforms with the GetPlatforms method: \r\n");
foreach (Platform platform in platforms)
{
    Console.WriteLine("Platform Name: " + platform.Name + "    ID: " + platform.Id);
}

使用權限

請參閱

參考

DatastoreManager 類別

DatastoreManager 成員

Microsoft.SmartDevice.Connectivity 命名空間