共用方式為


FSharpType.GetExceptionFields 方法 (F#)

依宣告順序,讀取 F# 例外狀況宣告中的所有欄位。

**命名空間/模組路徑:**Microsoft.FSharp.Reflection

組件:FSharp.Core (在 FSharp.Core.dll 中)

// Signature:
static member GetExceptionFields : Type * ?BindingFlags -> PropertyInfo []

// Usage:
FSharpType.GetExceptionFields (exceptionType)
FSharpType.GetExceptionFields (exceptionType, bindingFlags = bindingFlags)

參數

  • exceptionType
    型別:Type

    要讀取的例外狀況型別。

  • bindingFlags
    型別:BindingFlags

    選擇性的繫結旗標。

例外狀況

例外狀況

條件

ArgumentException

如果指定的型別不是例外狀況則擲回。

傳回值

陣列,包含例外狀況中每個欄位的 PropertyInfo

備註

假設 exceptionType 是例外狀況表示型別。如果不是,會引發 ArgumentException

平台

Windows 8 中, Windows 7, Windows Server 2012 上, Windows Server 2008 R2

版本資訊

F# 核心程式庫版本

支援版本:2.0, 4.0,可攜式執行檔 (PE)。

請參閱

參考

Reflection.FSharpType 類別 (F#)

Microsoft.FSharp.Reflection 命名空間 (F#)