Platform.GetDevices-Methode
Aktualisiert: November 2007
Ruft die Auflistung aller dieser Plattform zugeordneten Geräte ab.
Namespace: Microsoft.SmartDevice.Connectivity
Assembly: Microsoft.SmartDevice.Connectivity (in Microsoft.SmartDevice.Connectivity.dll)
Syntax
'Declaration
Public Function GetDevices As Collection(Of Device)
'Usage
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>
Rückgabewert
Typ: System.Collections.ObjectModel.Collection<Device>
Gibt eine Auflistung der dieser Plattform zugeordneten Geräte zurück.
Beispiele
' 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"));
}
Berechtigungen
- Volle Vertrauenswürdigkeit für den unmittelbaren Aufrufer. Dieser Member kann von nur teilweise vertrauenswürdigem Code nicht verwendet werden. Weitere Informationen finden Sie unter Verwenden von Bibliotheken aus teilweise vertrauenswürdigem Code.