다음을 통해 공유


Platform.GetDevices 메서드

업데이트: 2007년 11월

이 플랫폼과 연결된 모든 장치의 컬렉션을 가져옵니다.

네임스페이스:  Microsoft.SmartDevice.Connectivity
어셈블리:  Microsoft.SmartDevice.Connectivity(Microsoft.SmartDevice.Connectivity.dll)

구문

Public Function GetDevices As Collection(Of Device)

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>

반환 값

형식: System.Collections.ObjectModel.Collection<Device>

플랫폼과 연결된 장치의 컬렉션을 반환합니다.

예제

' 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"));
}

권한

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

Platform 클래스

Platform 멤버

Microsoft.SmartDevice.Connectivity 네임스페이스