NotSupportedException 類別

定義

當叫用的方法不受支援,或者嘗試讀取、尋找或寫入不支援叫用功能的資料流時,所擲回的例外狀況。

public ref class NotSupportedException : Exception
public ref class NotSupportedException : SystemException
public class NotSupportedException : Exception
public class NotSupportedException : SystemException
[System.Serializable]
public class NotSupportedException : SystemException
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public class NotSupportedException : SystemException
type NotSupportedException = class
    inherit Exception
type NotSupportedException = class
    inherit SystemException
[<System.Serializable>]
type NotSupportedException = class
    inherit SystemException
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type NotSupportedException = class
    inherit SystemException
Public Class NotSupportedException
Inherits Exception
Public Class NotSupportedException
Inherits SystemException
繼承
NotSupportedException
繼承
NotSupportedException
衍生
屬性

備註

NotSupportedException 表示已叫用的方法或屬性沒有任何實作存在。

NotSupportedException 會使用 HRESULT COR_E_NOTSUPPORTED,其值為 0x80131515。

如需執行個體的初始屬性值的清單NotSupportedException,請參閱NotSupportedException建構函式。

擲回 NotSupportedException 例外狀況

在下列情況下,您可能會考慮擲回 NotSupportedException 例外狀況:

  • 您正在實作一般用途介面,而且方法的數目沒有有意義的實作。 例如,如果您要建立實作 介面的 IConvertible 日期和時間類型,則會 NotSupportedException 擲回大部分轉換的例外狀況。

  • 您已繼承自需要覆寫許多方法的抽象類別。 不過,您只準備好提供這些子集的實作。 針對您決定不實作的方法,您可以選擇擲回 NotSupportedException

  • 您正在定義具有條件啟用作業狀態的一般用途類型。 例如,您的類型可以是唯讀或讀寫。 在此情況下:

    • 如果物件是唯讀的,則嘗試將值指派給實例的屬性,或呼叫修改實例狀態的方法應該擲回 NotSupportedException 例外狀況。

    • 您應該實作屬性,這個屬性會 Boolean 傳回值,指出特定功能是否可用。 例如,對於可以是唯讀或讀寫的類型,您可以實 IsReadOnly 作屬性,指出一組讀寫方法是否可用或無法使用。

處理 NotSupportedException 例外狀況

例外 NotSupportedException 狀況表示方法沒有實作,而且您不應該呼叫它。 您不應該處理例外狀況。 相反地,您應該執行的動作取決於例外狀況的原因:實作完全不存在,還是成員調用與物件的目的不一致 (,例如 FileStream.Write 呼叫唯讀 FileStream 物件上的 方法。

尚未提供實作,因為作業無法以有意義的方式執行。
當您在物件上呼叫方法時,這是常見的例外狀況,該物件提供抽象基類方法的實作,或實作一般用途介面,而且方法沒有有意義的實作。

例如, Convert 類別會實作 IConvertible 介面,這表示它必須包含方法,以將每個基本類型轉換成所有其他基本類型。 不過,您無法進行這些轉換。 因此,例如,呼叫 Convert.ToBoolean(DateTime) 方法會 NotSupportedException 擲回例外狀況,因為 與 Boolean 值之間 DateTime 沒有可能的轉換

若要消除例外狀況,您應該消除方法呼叫。

在 物件的狀態下,不支援方法呼叫。
您嘗試叫用因為物件狀態而無法使用其功能的成員。 您可以使用下列三種方式之一來消除例外狀況:

  • 您事先知道物件的狀態,但您已叫用不支援的方法或屬性。 在此情況下,成員調用是錯誤,您可以排除它。

  • 您事先知道物件的狀態 (通常是因為您的程式碼已) 具現化,但物件設定錯誤。 下列範例說明此問題。 它會建立唯讀 FileStream 物件,然後嘗試寫入它。

    using System;
    using System.IO;
    using System.Text;
    using System.Threading.Tasks;
    
    public class Example
    {
       public static async Task Main()
       {
          Encoding enc = Encoding.Unicode;
          String value = "This is a string to persist.";
          Byte[] bytes  = enc.GetBytes(value);
    
          FileStream fs = new FileStream(@".\TestFile.dat",
                                         FileMode.Open,
                                         FileAccess.Read);
          Task t = fs.WriteAsync(enc.GetPreamble(), 0, enc.GetPreamble().Length);
          Task t2 = t.ContinueWith( (a) => fs.WriteAsync(bytes, 0, bytes.Length) );
          await t2;
          fs.Close();
       }
    }
    // The example displays the following output:
    //    Unhandled Exception: System.NotSupportedException: Stream does not support writing.
    //       at System.IO.Stream.BeginWriteInternal(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state
    //    , Boolean serializeAsynchronously)
    //       at System.IO.FileStream.BeginWrite(Byte[] array, Int32 offset, Int32 numBytes, AsyncCallback userCallback, Object sta
    //    teObject)
    //       at System.IO.Stream.<>c.<BeginEndWriteAsync>b__53_0(Stream stream, ReadWriteParameters args, AsyncCallback callback,
    //    Object state)
    //       at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance,TArgs](TInstance thisRef, TArgs args, Func`5 beginMet
    //    hod, Func`3 endMethod)
    //       at System.IO.Stream.BeginEndWriteAsync(Byte[] buffer, Int32 offset, Int32 count)
    //       at System.IO.FileStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
    //       at System.IO.Stream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count)
    //       at Example.Main()
    
    open System.IO
    open System.Text
    
    let main = task {
        let enc = Encoding.Unicode
        let value = "This is a string to persist."
        let bytes  = enc.GetBytes value
    
        let fs = new FileStream(@".\TestFile.dat", FileMode.Open, FileAccess.Read)
        let t = fs.WriteAsync(enc.GetPreamble(), 0, enc.GetPreamble().Length)
        let t2 = t.ContinueWith(fun a -> fs.WriteAsync(bytes, 0, bytes.Length))
        let! _ = t2
        fs.Close()
    }
    main.Wait()
    
    // The example displays the following output:
    //    Unhandled Exception: System.NotSupportedException: Stream does not support writing.
    //       at System.IO.Stream.BeginWriteInternal(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state
    //    , Boolean serializeAsynchronously)
    //       at System.IO.FileStream.BeginWrite(Byte[] array, Int32 offset, Int32 numBytes, AsyncCallback userCallback, Object sta
    //    teObject)
    //       at System.IO.Stream.<>c.<BeginEndWriteAsync>b__53_0(Stream stream, ReadWriteParameters args, AsyncCallback callback,
    //    Object state)
    //       at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance,TArgs](TInstance thisRef, TArgs args, Func`5 beginMet
    //    hod, Func`3 endMethod)
    //       at System.IO.Stream.BeginEndWriteAsync(Byte[] buffer, Int32 offset, Int32 count)
    //       at System.IO.FileStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
    //       at System.IO.Stream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count)
    //       at <StartupCode:fs>.main()
    
    Imports System.IO
    Imports System.Text
    Imports System.Threading.Tasks
    
    Module Example
       Public Sub Main()
          Dim enc As Encoding = Encoding.Unicode
          Dim value As String = "This is a string to persist."
          Dim bytes() As Byte = enc.GetBytes(value)
    
          Dim fs As New FileStream(".\TestFile.dat", 
                                   FileMode.Open,
                                   FileAccess.Read)
          Dim t As Task = fs.WriteAsync(enc.GetPreamble(), 0, enc.GetPreamble().Length)
          Dim t2 As Task = t.ContinueWith(Sub(a) fs.WriteAsync(bytes, 0, bytes.Length)) 
          t2.Wait()
          fs.Close()
       End Sub
    End Module
    ' The example displays the following output:
    '    Unhandled Exception: System.NotSupportedException: Stream does not support writing.
    '       at System.IO.Stream.BeginWriteInternal(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state
    '    , Boolean serializeAsynchronously)
    '       at System.IO.FileStream.BeginWrite(Byte[] array, Int32 offset, Int32 numBytes, AsyncCallback userCallback, Object sta
    '    teObject)
    '       at System.IO.Stream.<>c.<BeginEndWriteAsync>b__53_0(Stream stream, ReadWriteParameters args, AsyncCallback callback,
    '    Object state)
    '       at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance,TArgs](TInstance thisRef, TArgs args, Func`5 beginMet
    '    hod, Func`3 endMethod)
    '       at System.IO.Stream.BeginEndWriteAsync(Byte[] buffer, Int32 offset, Int32 count)
    '       at System.IO.FileStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
    '       at System.IO.Stream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count)
    '       at Example.Main()
    

    您可以藉由確保具現化物件支援您想要的功能來消除例外狀況。 下列範例會藉由提供正確的引數給 FileStream.FileStream(String, FileMode, FileAccess) 建構函式來解決唯讀 FileStream 物件的問題。

  • 您事先不知道物件的狀態,而且物件不支援特定作業。 在大部分情況下,物件應該包含屬性或方法,指出它是否支援一組特定的作業。 您可以檢查 物件的值,並只在適當時叫用成員,藉以消除例外狀況。

    下列範例會 DetectEncoding 定義方法,這個方法會在嘗試從不支援讀取存取的資料流程開頭讀取時擲 NotSupportedException 回例外狀況。

    using System;
    using System.IO;
    using System.Threading.Tasks;
    
    public class Example
    {
       public static async Task Main()
       {
          String name = @".\TestFile.dat";
          var fs = new FileStream(name,
                                  FileMode.Create,
                                  FileAccess.Write);
             Console.WriteLine("Filename: {0}, Encoding: {1}",
                               name, await FileUtilities.GetEncodingType(fs));
       }
    }
    
    public class FileUtilities
    {
       public enum EncodingType
       { None = 0, Unknown = -1, Utf8 = 1, Utf16 = 2, Utf32 = 3 }
    
       public async static Task<EncodingType> GetEncodingType(FileStream fs)
       {
          Byte[] bytes = new Byte[4];
          int bytesRead = await fs.ReadAsync(bytes, 0, 4);
          if (bytesRead < 2)
             return EncodingType.None;
    
          if (bytesRead >= 3 & (bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF))
             return EncodingType.Utf8;
    
          if (bytesRead == 4) {
             var value = BitConverter.ToUInt32(bytes, 0);
             if (value == 0x0000FEFF | value == 0xFEFF0000)
                return EncodingType.Utf32;
          }
    
          var value16 = BitConverter.ToUInt16(bytes, 0);
          if (value16 == (ushort)0xFEFF | value16 == (ushort)0xFFFE)
             return EncodingType.Utf16;
    
          return EncodingType.Unknown;
       }
    }
    // The example displays the following output:
    //    Unhandled Exception: System.NotSupportedException: Stream does not support reading.
    //       at System.IO.FileStream.BeginRead(Byte[] array, Int32 offset, Int32 numBytes, AsyncCallback callback, Object state)
    //       at System.IO.Stream.<>c.<BeginEndReadAsync>b__46_0(Stream stream, ReadWriteParameters args, AsyncCallback callback, Object state)
    //       at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance, TArgs](TInstance thisRef, TArgs args, Func`5 beginMethod, Func`3 endMethod)
    //       at System.IO.Stream.BeginEndReadAsync(Byte[] buffer, Int32 offset, Int32 count)
    //       at System.IO.FileStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
    //       at System.IO.Stream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count)
    //       at FileUtilities.GetEncodingType(FileStream fs) in C:\Work\docs\program.cs:line 26
    //       at Example.Main() in C:\Work\docs\program.cs:line 13
    //       at Example.<Main>()
    
    open System
    open System.IO
    
    module FileUtilities =
        type EncodingType =
            | None = 0
            | Unknown = -1
            | Utf8 = 1
            | Utf16 = 2
            | Utf32 = 3
    
        let getEncodingType (fs: FileStream) = 
            task {
                let bytes = Array.zeroCreate<byte> 4
                let! bytesRead = fs.ReadAsync(bytes, 0, 4)
                if bytesRead < 2 then
                    return EncodingType.None
    
                elif bytesRead >= 3 && bytes[0] = 0xEFuy && bytes[1] = 0xBBuy && bytes[2] = 0xBFuy then
                    return EncodingType.Utf8
                else
                    let value = BitConverter.ToUInt32(bytes, 0)
                    if bytesRead = 4 && (value = 0x0000FEFFu || value = 0xFEFF0000u) then
                        return EncodingType.Utf32
                    else
                        let value16 = BitConverter.ToUInt16(bytes, 0)
                        if value16 = 0xFEFFus || value16 = 0xFFFEus then
                            return EncodingType.Utf16
                        else
                            return EncodingType.Unknown
            }
    
    let main _ = 
        task {
            let name = @".\TestFile.dat"
            let fs = new FileStream(name, FileMode.Create, FileAccess.Write)
            let! et = FileUtilities.getEncodingType fs
            printfn $"Filename: {name}, Encoding: {et}"
        }
    
    // The example displays the following output:
    //    Unhandled Exception: System.NotSupportedException: Stream does not support reading.
    //       at System.IO.FileStream.BeginRead(Byte[] array, Int32 offset, Int32 numBytes, AsyncCallback callback, Object state)
    //       at System.IO.Stream.<>c.<BeginEndReadAsync>b__46_0(Stream stream, ReadWriteParameters args, AsyncCallback callback, Object state)
    //       at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance, TArgs](TInstance thisRef, TArgs args, Func`5 beginMethod, Func`3 endMethod)
    //       at System.IO.Stream.BeginEndReadAsync(Byte[] buffer, Int32 offset, Int32 count)
    //       at System.IO.FileStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
    //       at System.IO.Stream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count)
    //       at FileUtilities.GetEncodingType(FileStream fs)
    //       at Example.Main()
    //       at Example.<Main>()
    
    Imports System.IO
    Imports System.Threading.Tasks
    
    Module Example
       Public Sub Main()
          Dim name As String = ".\TestFile.dat"
          Dim fs As New FileStream(name, 
                                   FileMode.Create,
                                   FileAccess.Write)
          Console.WriteLine("Filename: {0}, Encoding: {1}", 
                            name, FileUtilities.GetEncodingType(fs))
       End Sub
    End Module
    
    Public Class FileUtilities
       Public Enum EncodingType As Integer
          None = 0
          Unknown = -1
          Utf8 = 1
          Utf16 = 2
          Utf32 = 3
       End Enum
       
       Public Shared Function GetEncodingType(fs As FileStream) As EncodingType
          Dim bytes(3) As Byte
          Dim t As Task(Of Integer) = fs.ReadAsync(bytes, 0, 4)
          t.Wait()
          Dim bytesRead As Integer = t.Result
          If bytesRead < 2 Then Return EncodingType.None
          
          If bytesRead >= 3 And (bytes(0) = &hEF AndAlso bytes(1) = &hBB AndAlso bytes(2) = &hBF) Then
             Return EncodingType.Utf8
          End If
          
          If bytesRead = 4 Then 
             Dim value As UInteger = BitConverter.ToUInt32(bytes, 0)
             If value = &h0000FEFF Or value = &hFEFF0000 Then
                Return EncodingType.Utf32
             End If
          End If
          
          Dim value16 As UInt16 = BitConverter.ToUInt16(bytes, 0)
          If value16 = &hFEFF Or value16 = &hFFFE Then 
             Return EncodingType.Utf16
          End If
          
          Return EncodingType.Unknown
       End Function
    End Class
    ' The example displays the following output:
    '    Unhandled Exception: System.NotSupportedException: Stream does not support reading.
    '       at System.IO.Stream.BeginReadInternal(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state,
    '     Boolean serializeAsynchronously)
    '       at System.IO.FileStream.BeginRead(Byte[] array, Int32 offset, Int32 numBytes, AsyncCallback userCallback, Object stat
    '    eObject)
    '       at System.IO.Stream.<>c.<BeginEndReadAsync>b__43_0(Stream stream, ReadWriteParameters args, AsyncCallback callback, O
    '    bject state)
    '       at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance,TArgs](TInstance thisRef, TArgs args, Func`5 beginMet
    '    hod, Func`3 endMethod)
    '       at System.IO.Stream.BeginEndReadAsync(Byte[] buffer, Int32 offset, Int32 count)
    '       at System.IO.FileStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
    '       at System.IO.Stream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count)
    '       at FileUtilities.GetEncodingType(FileStream fs)
    '       at Example.Main()
    

    如果資料流程是唯讀的 FileStream.CanRead ,您可以檢查 屬性的值並結束 方法,藉以消除例外狀況。

       public static async Task<EncodingType> GetEncodingType(FileStream fs)
       {
          if (!fs.CanRead)
             return EncodingType.Unknown;
    
          Byte[] bytes = new Byte[4];
          int bytesRead = await fs.ReadAsync(bytes, 0, 4);
          if (bytesRead < 2)
             return EncodingType.None;
    
          if (bytesRead >= 3 & (bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF))
             return EncodingType.Utf8;
    
          if (bytesRead == 4) {
             var value = BitConverter.ToUInt32(bytes, 0);
             if (value == 0x0000FEFF | value == 0xFEFF0000)
                return EncodingType.Utf32;
          }
    
          var value16 = BitConverter.ToUInt16(bytes, 0);
          if (value16 == (ushort)0xFEFF | value16 == (ushort)0xFFFE)
             return EncodingType.Utf16;
    
          return EncodingType.Unknown;
       }
    }
    // The example displays the following output:
    //       Filename: .\TestFile.dat, Encoding: Unknown
    
    let getEncodingType (fs: FileStream) = 
        task {
            if not fs.CanRead then
                return EncodingType.Unknown
            else
                let bytes = Array.zeroCreate<byte> 4
                let! bytesRead = fs.ReadAsync(bytes, 0, 4)
                if bytesRead < 2 then
                    return EncodingType.None
    
                elif bytesRead >= 3 && bytes[0] = 0xEFuy && bytes[1] = 0xBBuy && bytes[2] = 0xBFuy then
                    return EncodingType.Utf8
                else
                    let value = BitConverter.ToUInt32(bytes, 0)
                    if bytesRead = 4 && (value = 0x0000FEFFu || value = 0xFEFF0000u) then
                        return EncodingType.Utf32
                    else
                        let value16 = BitConverter.ToUInt16(bytes, 0)
                        if value16 = 0xFEFFus || value16 = 0xFFFEus then
                            return EncodingType.Utf16
                        else
                            return EncodingType.Unknown
        }
    // The example displays the following output:
    //       Filename: .\TestFile.dat, Encoding: Unknown
    
    Public Class FileUtilities
       Public Enum EncodingType As Integer
          None = 0
          Unknown = -1
          Utf8 = 1
          Utf16 = 2
          Utf32 = 3
       End Enum
       
       Public Shared Function GetEncodingType(fs As FileStream) As EncodingType
          If Not fs.CanRead Then
             Return EncodingType.Unknown
    
          Dim bytes(3) As Byte
          Dim t As Task(Of Integer) = fs.ReadAsync(bytes, 0, 4)
          t.Wait()
          Dim bytesRead As Integer = t.Result
          If bytesRead < 2 Then Return EncodingType.None
          
          If bytesRead >= 3 And (bytes(0) = &hEF AndAlso bytes(1) = &hBB AndAlso bytes(2) = &hBF) Then
             Return EncodingType.Utf8
          End If
          
          If bytesRead = 4 Then 
             Dim value As UInteger = BitConverter.ToUInt32(bytes, 0)
             If value = &h0000FEFF Or value = &hFEFF0000 Then
                Return EncodingType.Utf32
             End If
          End If
          
          Dim value16 As UInt16 = BitConverter.ToUInt16(bytes, 0)
          If value16 = &hFEFF Or value16 = &hFFFE Then 
             Return EncodingType.Utf16
          End If
          
          Return EncodingType.Unknown
       End Function
    End Class
    ' The example displays the following output:
    '       Filename: .\TestFile.dat, Encoding: Unknown
    

例外 NotSupportedException 狀況與兩個其他例外狀況類型緊密相關;

NotImplementedException.
當方法可以實作但不是時,就會擲回這個例外狀況,可能是因為成員將在較新版本中實作、成員無法在特定平臺上使用,或成員屬於抽象類別,而衍生類別必須提供實作。

InvalidOperationException
這個例外狀況會在物件執行要求作業的案例中擲回,而且物件狀態決定是否可以執行作業。

.NET Compact Framework 附注

使用 .NET Compact Framework 並在原生函式上使用 P/Invoke 時,如果:

  • Managed 程式碼中的宣告不正確。

  • .NET Compact Framework 不支援您嘗試執行的動作。

  • DLL 名稱在輸出期間損壞。

如果擲回例外狀況 NotSupportedException ,請檢查:

  • 對於 .NET Compact Framework P/Invoke 限制的任何違規。

  • 需要預先配置記憶體的任何引數。 如果這些引數存在的話,您必須將參考傳遞至現有變數。

  • 輸出函式的所有名稱都是正確的。 這可以使用 DumpBin.exe進行驗證。

  • 您並未嘗試傳遞過多的引數。

建構函式

NotSupportedException()

初始化 NotSupportedException 類別的新執行個體,設定該新執行個體的 Message 屬性為描述錯誤的系統提供訊息。 此訊息會考慮到目前系統的文化特性。

NotSupportedException(SerializationInfo, StreamingContext)

使用序列化資料,初始化 NotSupportedException 類別的新執行個體。

NotSupportedException(String)

使用指定的錯誤訊息,初始化 NotSupportedException 類別的新執行個體。

NotSupportedException(String, Exception)

使用指定的錯誤訊息以及造成此例外狀況的內部例外狀況的參考,初始化 NotSupportedException 類別的新執行個體。

屬性

Data

取得鍵值組的集合,這些鍵值組會提供關於例外狀況的其他使用者定義資訊。

(繼承來源 Exception)
HelpLink

取得或設定與這個例外狀況相關聯的說明檔連結。

(繼承來源 Exception)
HResult

取得或設定 HRESULT,它是指派給特定例外狀況的編碼數值。

(繼承來源 Exception)
InnerException

取得造成目前例外狀況的 Exception 執行個體。

(繼承來源 Exception)
Message

取得描述目前例外狀況的訊息。

(繼承來源 Exception)
Source

取得或設定造成錯誤的應用程式或物件的名稱。

(繼承來源 Exception)
StackTrace

取得呼叫堆疊上即時運算框架的字串表示。

(繼承來源 Exception)
TargetSite

取得擲回目前例外狀況的方法。

(繼承來源 Exception)

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetBaseException()

在衍生類別中覆寫時,傳回一或多個後續的例外狀況的根本原因 Exception

(繼承來源 Exception)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetObjectData(SerializationInfo, StreamingContext)

在衍生類別中覆寫時,使用例外狀況的資訊設定 SerializationInfo

(繼承來源 Exception)
GetType()

取得目前執行個體的執行階段類型。

(繼承來源 Exception)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

建立並傳回目前例外狀況的字串表示。

(繼承來源 Exception)

事件

SerializeObjectState
已過時。

當例外狀況序列化,以建立包含例外狀況相關序列化資料的例外狀況狀態物件時,就會發生此事件。

(繼承來源 Exception)

適用於

另請參閱