XmlException Oluşturucular

Tanım

XmlException sınıfının yeni bir örneğini başlatır.

Aşırı Yüklemeler

Name Description
XmlException()

XmlException sınıfının yeni bir örneğini başlatır.

XmlException(String)

Belirtilen bir hata iletisiyle sınıfının yeni bir örneğini XmlException başlatır.

XmlException(SerializationInfo, StreamingContext)
Geçersiz.

ve XmlException nesnelerindeki SerializationInfo bilgileri StreamingContext kullanarak sınıfın yeni bir örneğini başlatır.

XmlException(String, Exception)

XmlException sınıfının yeni bir örneğini başlatır.

XmlException(String, Exception, Int32, Int32)

Belirtilen ileti, iç özel durum, satır numarası ve satır konumu ile sınıfın XmlException yeni bir örneğini başlatır.

XmlException()

Kaynak:
XmlException.cs
Kaynak:
XmlException.cs
Kaynak:
XmlException.cs
Kaynak:
XmlException.cs
Kaynak:
XmlException.cs

XmlException sınıfının yeni bir örneğini başlatır.

public:
 XmlException();
public XmlException();
Public Sub New ()

Açıklamalar

XmlException, XML işleme sırasında sorun oluşursa oluşan xml ile ilgili genel bir hatadır. Aşağıdaki örnek, kişiler< bitiş etiketi yanlış yazıldığından >bir XML özel durumu oluşturur:

using System;
using System.Xml.Linq;

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

Şunlara uygulanır

XmlException(String)

Kaynak:
XmlException.cs
Kaynak:
XmlException.cs
Kaynak:
XmlException.cs
Kaynak:
XmlException.cs
Kaynak:
XmlException.cs

Belirtilen bir hata iletisiyle sınıfının yeni bir örneğini XmlException başlatır.

public:
 XmlException(System::String ^ message);
public XmlException(string message);
public XmlException(string? message);
new System.Xml.XmlException : string -> System.Xml.XmlException
Public Sub New (message As String)

Parametreler

message
String

Hata açıklaması.

Şunlara uygulanır

XmlException(SerializationInfo, StreamingContext)

Kaynak:
XmlException.cs
Kaynak:
XmlException.cs
Kaynak:
XmlException.cs
Kaynak:
XmlException.cs
Kaynak:
XmlException.cs

Dikkat

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

ve XmlException nesnelerindeki SerializationInfo bilgileri StreamingContext kullanarak sınıfın yeni bir örneğini başlatır.

protected:
 XmlException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected XmlException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
protected XmlException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Xml.XmlException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Xml.XmlException
new System.Xml.XmlException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Xml.XmlException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

Parametreler

info
SerializationInfo

bir SerializationInfo öğesinin tüm özelliklerini XmlExceptioniçeren nesne.

context
StreamingContext

Bağlam StreamingContext bilgilerini içeren nesne.

Öznitelikler

Şunlara uygulanır

XmlException(String, Exception)

Kaynak:
XmlException.cs
Kaynak:
XmlException.cs
Kaynak:
XmlException.cs
Kaynak:
XmlException.cs
Kaynak:
XmlException.cs

XmlException sınıfının yeni bir örneğini başlatır.

public:
 XmlException(System::String ^ message, Exception ^ innerException);
public XmlException(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)

Parametreler

message
String

Hata koşulunun açıklaması.

innerException
Exception

Eğer Exception varsa, onu fırlatan XmlException. Bu değer olabilir null.

Şunlara uygulanır

XmlException(String, Exception, Int32, Int32)

Kaynak:
XmlException.cs
Kaynak:
XmlException.cs
Kaynak:
XmlException.cs
Kaynak:
XmlException.cs
Kaynak:
XmlException.cs

Belirtilen ileti, iç özel durum, satır numarası ve satır konumu ile sınıfın XmlException yeni bir örneğini başlatır.

public:
 XmlException(System::String ^ message, Exception ^ innerException, int lineNumber, int linePosition);
public XmlException(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)

Parametreler

message
String

Hata açıklaması.

innerException
Exception

Geçerli özel durumun nedeni olan özel durum. Bu değer olabilir null.

lineNumber
Int32

Hatanın oluştuğu yeri gösteren satır numarası.

linePosition
Int32

Hatanın oluştuğu yeri gösteren satır konumu.

Şunlara uygulanır