DatastoreManager.GetPlatform 方法

更新:2007 年 11 月

获取与指定平台 ID 相对应的平台对象。

命名空间:  Microsoft.SmartDevice.Connectivity
程序集:  Microsoft.SmartDevice.Connectivity(在 Microsoft.SmartDevice.Connectivity.dll 中)

语法

声明
Public Function GetPlatform ( _
    platformId As ObjectId _
) As Platform
用法
Dim instance As DatastoreManager
Dim platformId As ObjectId
Dim returnValue As Platform

returnValue = instance.GetPlatform(platformId)
public Platform GetPlatform(
    ObjectId platformId
)
public:
Platform^ GetPlatform(
    ObjectId^ platformId
)
public function GetPlatform(
    platformId : ObjectId
) : Platform

参数

返回值

类型:Microsoft.SmartDevice.Connectivity.Platform

具有指定平台 ID 的平台。

异常

异常 条件
ArgumentNullException

输入字符串为 nullnull 引用(在 Visual Basic 中为 Nothing)。

PlatformNotFoundException

未在数据存储内注册的平台列表中找到给定的平台。

示例

' Get the Windows Mobile 5.0 Smartphone platform
Dim wm5sp As New ObjectId(New Guid("BD0CC567-F6FD-4ca3-99D2-063EFDFC0A39"))
Dim p As Platform = dsmgr.GetPlatform(wm5sp)

' Output information
Console.WriteLine(vbCr + vbLf + vbCr + vbLf + _
                  "Get the WM5 Smartphone platform using the GetPlatform method: " + _
                  vbCr + vbLf)
Console.WriteLine("Platform Name: " + p.Name + "    ID: " + p.Id.ToString())
// Get the Windows Mobile 5.0 Smartphone platform
ObjectId wm5sp = new ObjectId(new Guid("BD0CC567-F6FD-4ca3-99D2-063EFDFC0A39"));
Platform p = dsmgr.GetPlatform(wm5sp);

// Output information
Console.WriteLine("\r\n\r\nGet the WM5 Smartphone platform using the GetPlatform method: \r\n");
Console.WriteLine("Platform Name: " + p.Name + "    ID: " + p.Id);

权限

另请参见

参考

DatastoreManager 类

DatastoreManager 成员

Microsoft.SmartDevice.Connectivity 命名空间