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 命名空间