RegistrationErrorInfo.ErrorString Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan deskripsi dari ErrorCode.
public:
property System::String ^ ErrorString { System::String ^ get(); };
public string ErrorString { get; }
member this.ErrorString : string
Public ReadOnly Property ErrorString As String
Nilai Properti
Penjabaran dari ErrorCode.
Contoh
Contoh kode berikut menunjukkan cara mengambil string kesalahan dari RegistrationErrorInfo
objek.
// 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
Berlaku untuk
Berkolaborasi dengan kami di GitHub
Sumber untuk konten ini dapat ditemukan di GitHub, yang juga dapat Anda gunakan untuk membuat dan meninjau masalah dan menarik permintaan. Untuk informasi selengkapnya, lihat panduan kontributor kami.