Partilhar via


RegistrationErrorInfo.ErrorString Propriedade

Definição

Obtém a descrição da ErrorCode.

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

Valor da propriedade

A descrição do ErrorCode.

Exemplos

O exemplo de código a seguir mostra como recuperar a cadeia de caracteres de erro de um RegistrationErrorInfo objeto .

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

Aplica-se a