Visual Basic (Declaration) | |
---|---|
Public Function GetServiceKey( _ ByVal name As String, _ Optional ByVal throwIfNotFound As Boolean _ ) As ServiceKeyElement |
Visual Basic (Usage) | ![]() |
---|---|
Dim instance As ObjectServerElement Dim name As String Dim throwIfNotFound As Boolean Dim value As ServiceKeyElement value = instance.GetServiceKey(name, throwIfNotFound) |
C# | |
---|---|
public ServiceKeyElement GetServiceKey( string name, bool throwIfNotFound ) |
C++/CLI | |
---|---|
public: ServiceKeyElement^ GetServiceKey( String^ name, bool throwIfNotFound ) |
Parameters
- name
- throwIfNotFound
Exception | Description |
---|---|
System.InvalidOperationException | Thrown if no service keys are defined, or the key is not found |
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.
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family