Aracılığıyla paylaş


XmlException Oluşturucular

Tanım

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

Aşırı Yüklemeler

XmlException()

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

XmlException(String)

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

XmlException(SerializationInfo, StreamingContext)
Geçersiz.

ve StreamingContext nesnelerindeki XmlException bilgileri kullanarak sınıfının yeni bir örneğini SerializationInfo 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()

Source:
XmlException.cs
Source:
XmlException.cs
Source:
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)

Source:
XmlException.cs
Source:
XmlException.cs
Source:
XmlException.cs

Belirtilen 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)

Source:
XmlException.cs
Source:
XmlException.cs
Source:
XmlException.cs

Dikkat

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

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

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}")]
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
[<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
Protected Sub New (info As SerializationInfo, context As StreamingContext)

Parametreler

info
SerializationInfo

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

context
StreamingContext

StreamingContext Bağlam bilgilerini içeren nesne.

Öznitelikler

Şunlara uygulanır

XmlException(String, Exception)

Source:
XmlException.cs
Source:
XmlException.cs
Source:
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

Varsa Exception , öğesini fırlatan XmlException. Bu değer olabilir null.

Şunlara uygulanır

XmlException(String, Exception, Int32, Int32)

Source:
XmlException.cs
Source:
XmlException.cs
Source:
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 nerede oluştuğunu gösteren satır numarası.

linePosition
Int32

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

Şunlara uygulanır