Condividi tramite


RegistrationErrorInfo.ErrorString Proprietà

Definizione

Ottiene la descrizione dell'oggetto ErrorCode.

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

Valore della proprietà

Descrizione dell'oggetto ErrorCode.

Esempio

Nell'esempio di codice seguente viene illustrato come recuperare la stringa di errore da un RegistrationErrorInfo oggetto.

// 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

Si applica a