DevForce Help Reference
GetServiceKey Method


Return the ServiceKey with the given name.
Syntax
'Declaration
 
Public Function GetServiceKey( _
   ByVal name As String, _
   Optional ByVal throwIfNotFound As Boolean _
) As ServiceKeyElement
'Usage
 
Dim instance As ObjectServerElement
Dim name As String
Dim throwIfNotFound As Boolean
Dim value As ServiceKeyElement
 
value = instance.GetServiceKey(name, throwIfNotFound)
public ServiceKeyElement GetServiceKey( 
   string name,
   bool throwIfNotFound
)

Parameters

name
throwIfNotFound
Exceptions
ExceptionDescription
System.InvalidOperationExceptionThrown if no service keys are defined, or the key is not found
Remarks
If the name provided is null or an empty string then the default key is returned. This will throw an exception if the key is not found, or return null if the throwIfNotFound parameters is false.
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ObjectServerElement Class
ObjectServerElement Members

Send Feedback