XmlException Konstruktoren
Definition
Initialisiert eine neue Instanz der XmlException
-Klasse.Initializes a new instance of the XmlException
class.
Überlädt
XmlException() |
Initialisiert eine neue Instanz der |
XmlException(String) |
Initialisiert eine neue Instanz der |
XmlException(SerializationInfo, StreamingContext) |
Initialisiert eine neue Instanz der |
XmlException(String, Exception) |
Initialisiert eine neue Instanz der |
XmlException(String, Exception, Int32, Int32) |
Initialisiert eine neue Instanz der |
XmlException()
Initialisiert eine neue Instanz der XmlException
-Klasse.Initializes a new instance of the XmlException
class.
public:
XmlException();
public XmlException ();
Public Sub New ()
Hinweise
Der XmlException
ist ein generischer XML-bezogener Fehler, der ausgelöst wird, wenn während der XML-Verarbeitung Probleme auftreten.The XmlException
is a generic XML-related error that is thrown if problems occur during XML processing. Im folgenden Beispiel wird eine XML-Ausnahme ausgelöst, da das <contacts> Endtag falsch geschrieben ist:The following example throws an XML exception because the <contacts> end tag is misspelled:
try {
XElement contacts = XElement.Parse(
@"<Contacts>
<Contact>
<Name>Jim Wilson</Name>
</Contact>
</Contcts>");
Console.WriteLine(contacts);
}
catch (System.Xml.XmlException e)
{
Console.WriteLine(e.Message);
}
Try
Dim contacts As XElement = XElement.Parse(
"<Contacts>
<Contact>
<Name>Jim Wilson</Name>
</Contact>
</Contcts>")
Console.WriteLine(contacts)
Catch e As System.Xml.XmlException
Console.WriteLine(e.Message)
End Try
Gilt für:
XmlException(String)
Initialisiert eine neue Instanz der XmlException
-Klasse mit einer angegebenen Fehlermeldung.Initializes a new instance of the XmlException
class with a specified error message.
public:
XmlException(System::String ^ message);
public XmlException (string message);
new System.Xml.XmlException : string -> System.Xml.XmlException
Public Sub New (message As String)
Parameter
- message
- String
Die Fehlerbeschreibung.The error description.
Gilt für:
XmlException(SerializationInfo, StreamingContext)
Initialisiert eine neue Instanz der XmlException
-Klasse unter Verwendung der Informationen im SerializationInfo-Objekt und im StreamingContext-Objekt.Initializes a new instance of the XmlException
class using the information in the SerializationInfo and StreamingContext objects.
protected:
XmlException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected XmlException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Xml.XmlException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Xml.XmlException
Protected Sub New (info As SerializationInfo, context As StreamingContext)
Parameter
- info
- SerializationInfo
Das SerializationInfo
-Objekt, das alle Eigenschaften einer XmlException
enthält.The SerializationInfo
object containing all the properties of an XmlException
.
- context
- StreamingContext
Das StreamingContext
-Objekt, das die Kontextinformationen enthält.The StreamingContext
object containing the context information.
Gilt für:
XmlException(String, Exception)
Initialisiert eine neue Instanz der XmlException
-Klasse.Initializes a new instance of the XmlException
class.
public:
XmlException(System::String ^ message, Exception ^ innerException);
public XmlException (string message, Exception innerException);
new System.Xml.XmlException : string * Exception -> System.Xml.XmlException
Public Sub New (message As String, innerException As Exception)
Parameter
- message
- String
Die Beschreibung des Fehlerzustands.The description of the error condition.
- innerException
- Exception
Die Exception, die die XmlException
ausgelöst hat (falls eine Ausnahme ausgelöst wurde).The Exception that threw the XmlException
, if any. Dieser Wert kann null
sein.This value can be null
.
Gilt für:
XmlException(String, Exception, Int32, Int32)
Initialisiert eine neue Instanz der XmlException
-Klasse mit der angegebenen Meldung, inneren Ausnahme, Zeilennummer und Zeilenposition.Initializes a new instance of the XmlException
class with the specified message, inner exception, line number, and line position.
public:
XmlException(System::String ^ message, Exception ^ innerException, int lineNumber, int linePosition);
public XmlException (string message, Exception innerException, int lineNumber, int linePosition);
new System.Xml.XmlException : string * Exception * int * int -> System.Xml.XmlException
Public Sub New (message As String, innerException As Exception, lineNumber As Integer, linePosition As Integer)
Parameter
- message
- String
Die Fehlerbeschreibung.The error description.
- innerException
- Exception
Die Ausnahme, die die Ursache der aktuellen Ausnahme ist.The exception that is the cause of the current exception. Dieser Wert kann null
sein.This value can be null
.
- lineNumber
- Int32
Die Nummer der Zeile, in der der Fehler aufgetreten ist.The line number indicating where the error occurred.
- linePosition
- Int32
Die Position der Zeile, an der der Fehler aufgetreten ist.The line position indicating where the error occurred.