Freigeben über


RegistrationErrorInfo.ErrorString Eigenschaft

Definition

Ruft die Beschreibung von ErrorCode ab.

public:
 property System::String ^ ErrorString { System::String ^ get(); };
public string ErrorString { get; }
member this.ErrorString : string
Public ReadOnly Property ErrorString As String

Eigenschaftswert

Die Beschreibung des ErrorCode-Objekts.

Beispiele

Im folgenden Codebeispiel wird veranschaulicht, wie die Fehlerzeichenfolge aus einem RegistrationErrorInfo -Objekt abgerufen wird.

// Check whether the ErrorInfo property of the RegistrationException object is null. 
// If there is no extended error information about 
// methods related to multiple COM+ objects ErrorInfo will be null.
if ( e->ErrorInfo != nullptr )
{
   // Gets an array of RegistrationErrorInfo objects describing registration errors
   array<RegistrationErrorInfo^>^ registrationErrorInfos = e->ErrorInfo;
   
   // Iterate through the array of RegistrationErrorInfo objects and disply the 
   // ErrorString for each object.
   System::Collections::IEnumerator^ myEnum = registrationErrorInfos->GetEnumerator();
   while ( myEnum->MoveNext() )
   {
      RegistrationErrorInfo^ registrationErrorInfo = (RegistrationErrorInfo^)( myEnum->Current );
      Console::WriteLine( registrationErrorInfo->ErrorString );
   }
}
// Check whether the ErrorInfo property of the RegistrationException object is null.
// If there is no extended error information about
// methods related to multiple COM+ objects ErrorInfo will be null.
if(e.ErrorInfo != null)
{
    // Gets an array of RegistrationErrorInfo objects describing registration errors
    RegistrationErrorInfo[] registrationErrorInfos = e.ErrorInfo;

    // Iterate through the array of RegistrationErrorInfo objects and disply the
    // ErrorString for each object.

    foreach (RegistrationErrorInfo registrationErrorInfo in registrationErrorInfos)
    {
        Console.WriteLine(registrationErrorInfo.ErrorString);
    }
}
' Check whether the ErrorInfo property of the RegistrationException object is null. 
' If there is no extended error information about 
' methods related to multiple COM+ objects ErrorInfo will be null.
If Not (e.ErrorInfo Is Nothing) Then
    ' Gets an array of RegistrationErrorInfo objects describing registration errors
    Dim registrationErrorInfos As RegistrationErrorInfo() = e.ErrorInfo

    ' Iterate through the array of RegistrationErrorInfo objects and disply the 
    ' ErrorString for each object.
    Dim registrationErrorInfo As RegistrationErrorInfo
    For Each registrationErrorInfo In registrationErrorInfos
        MsgBox(registrationErrorInfo.ErrorString)
    Next registrationErrorInfo
End If

Gilt für: