Compartir vía


RegistrationErrorInfo.ErrorString Propiedad

Definición

Obtiene la descripción de ErrorCode.

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

Valor de propiedad

Descripción del objeto ErrorCode.

Ejemplos

En el ejemplo de código siguiente se muestra cómo recuperar la cadena de error de un 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

Se aplica a