HtmlElementErrorEventArgs.Description 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 string deskriptif yang sesuai dengan kesalahan.
public:
property System::String ^ Description { System::String ^ get(); };
public string Description { get; }
member this.Description : string
Public ReadOnly Property Description As String
Nilai Properti
String deskriptif yang sesuai dengan kesalahan.
Contoh
Contoh kode berikut menunjukkan penggunaan anggota ini. Dalam contoh, penanganan aktivitas melaporkan terjadinya HtmlWindow.Error peristiwa. Laporan ini membantu Anda mempelajari kapan peristiwa terjadi dan dapat membantu Anda dalam penelusuran kesalahan. Untuk melaporkan beberapa peristiwa atau pada peristiwa yang sering terjadi, pertimbangkan untuk mengganti MessageBox.Show dengan Console.WriteLine atau menambahkan pesan ke multibaris TextBox.
Untuk menjalankan kode contoh, tempelkan ke dalam proyek yang berisi instans jenis HtmlWindow bernama HtmlWindow1
. Kemudian pastikan bahwa penanganan aktivitas dikaitkan dengan HtmlWindow.Error peristiwa.
private void HtmlWindow1_Error(Object sender, HtmlElementErrorEventArgs e) {
System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "Description", e.Description );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Handled", e.Handled );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "LineNumber", e.LineNumber );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Url", e.Url );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "Error Event" );
}
Private Sub HtmlWindow1_Error(sender as Object, e as HtmlElementErrorEventArgs) _
Handles HtmlWindow1.Error
Dim messageBoxVB as New System.Text.StringBuilder()
messageBoxVB.AppendFormat("{0} = {1}", "Description", e.Description)
messageBoxVB.AppendLine()
messageBoxVB.AppendFormat("{0} = {1}", "Handled", e.Handled)
messageBoxVB.AppendLine()
messageBoxVB.AppendFormat("{0} = {1}", "LineNumber", e.LineNumber)
messageBoxVB.AppendLine()
messageBoxVB.AppendFormat("{0} = {1}", "Url", e.Url)
messageBoxVB.AppendLine()
MessageBox.Show(messageBoxVB.ToString(),"Error Event")
End Sub