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
参数
platformId
类型:Microsoft.SmartDevice.Connectivity.ObjectId一个表示唯一平台 ID 的 ObjectId。
返回值
类型: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);
权限
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。