SecurityException.Method 屬性

定義

取得或設定與例外狀況關聯之方法的相關資訊。Gets or sets the information about the method associated with the exception.

public:
 property System::Reflection::MethodInfo ^ Method { System::Reflection::MethodInfo ^ get(); void set(System::Reflection::MethodInfo ^ value); };
public System.Reflection.MethodInfo? Method { get; set; }
public System.Reflection.MethodInfo Method { get; set; }
[System.Runtime.InteropServices.ComVisible(false)]
public System.Reflection.MethodInfo Method { get; set; }
member this.Method : System.Reflection.MethodInfo with get, set
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.Method : System.Reflection.MethodInfo with get, set
Public Property Method As MethodInfo

屬性值

MethodInfo

描述方法的 MethodInfo 物件。A MethodInfo object describing the method.

屬性

備註

重要

使用此物件的執行個體時,若並用了不信任的資料,會造成安全性上的風險。Using an instance of this object with untrusted data is a security risk. 使用此物件時,請一律使用信任的資料。Use this object only with trusted data. 如需詳細資訊,請參閱資料驗證For more information, see Data Validation.

此屬性包含下列其中一項:This property contains one of the following:

  • 當觸發例外狀況的安全性檢查發生時,失敗元件所執行之方法的相關資訊。Information about the method that the failed assembly was executing when the security check that triggered the exception occurred.

  • PermitOnly在呼叫堆疊上放置或安全性動作之方法的相關資訊 Deny (如果是因為或發生失敗) PermitOnly DenyInformation about the method that placed either a PermitOnly or Deny security action on the call stack, in the case of a failure due to a PermitOnly or Deny.

  • null,在無法屬性為特定方法的情況下。null, in the case of a failure that is impossible to attribute to a specific method.

MethodInfo物件會提供可唯一識別方法的方法名稱、類別名稱和元件名稱資訊。The MethodInfo object provides the method name, class name, and assembly name information that uniquely identifies the method.

適用於