Subscriber.GetDevices Method
Gets all subscriber devices for the subscriber.
네임스페이스: Microsoft.SqlServer.NotificationServices
어셈블리: Microsoft.SqlServer.NotificationServices (in microsoft.sqlserver.notificationservices.dll)
구문
‘선언
Public Function GetDevices As SubscriberDeviceEnumeration
public SubscriberDeviceEnumeration GetDevices ()
public:
virtual SubscriberDeviceEnumeration^ GetDevices () sealed
public final SubscriberDeviceEnumeration GetDevices ()
public final function GetDevices () : SubscriberDeviceEnumeration
반환 값
A SubscriberDeviceEnumeration that contains all devices for the subscriber.
예
The following examples show how to use the GetDevices method to retrieve all devices for a subscriber:
Dim instanceName As String = "Tutorial"
' Create the NSInstance object.
Dim testInstance As NSInstance = New NSInstance(instanceName)
' Create the Subscriber object.
Dim testSubscriber As Subscriber = New Subscriber(testInstance)
' Set the subscriber ID so that the
' correct records are retrieved.
testSubscriber.SubscriberId = "TestUser1"
' Retrieve the subscriber's devices.
Dim testSubscriberDeviceEnumeration As _
SubscriberDeviceEnumeration = testSubscriber.GetDevices()
' Print each device to the console.
Dim singleSubDevice As SubscriberDevice
For Each singleSubDevice In testSubscriberDeviceEnumeration
Console.WriteLine(singleSubDevice.DeviceName)
Next
Console.ReadLine()
string instanceName = "Tutorial";
// Create the NSInstance object.
NSInstance testInstance = new NSInstance(instanceName);
// Create the Subscriber object.
Subscriber testSubscriber = new Subscriber(testInstance);
// Set the subscriber ID so that the
// correct records are retrieved.
testSubscriber.SubscriberId = "TestUser1";
// Retrieve the subscriber's devices.
SubscriberDeviceEnumeration testSubscriberDeviceEnumeration =
testSubscriber.GetDevices();
// Print each device to the console.
foreach (SubscriberDevice singleSubDevice in
testSubscriberDeviceEnumeration)
{
Console.WriteLine(singleSubDevice.DeviceName);
}
Console.ReadLine();
스레드 보안
Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
플랫폼
개발 플랫폼
지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.
대상 플랫폼
지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.
참고 항목
참조
Subscriber Class
Subscriber Members
Microsoft.SqlServer.NotificationServices Namespace