SkipLocalsInitAttribute 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
指示編譯程式發出元數據時,不應在巢狀方法標頭中設定 .locals init 旗標。
public ref class SkipLocalsInitAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Event | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, Inherited=false)]
public sealed class SkipLocalsInitAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Event | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, Inherited=false)>]
type SkipLocalsInitAttribute = class
inherit Attribute
Public NotInheritable Class SkipLocalsInitAttribute
Inherits Attribute
- 繼承
- 屬性
備註
此屬性不安全,因為在某些情況下可能會向應用程式揭露未初始化的記憶體(例如,讀取未初始化的堆疊配置記憶體)。 若直接套用於某個方法,該屬性會套用到該方法及其所有巢狀函式,包括 lambda 與局部函式。 若套用於型別或模組,則適用於巢狀中所有方法。 此屬性在組裝上是刻意不允許的。 若要套用屬性給多個型別宣告,請在模組層級使用。
建構函式
| 名稱 | Description |
|---|---|
| SkipLocalsInitAttribute() |
初始化 SkipLocalsInitAttribute 類別的新執行個體。 |
屬性
| 名稱 | Description |
|---|---|
| TypeId |
在衍生類別中實作時,取得這個 Attribute的唯一標識碼。 (繼承來源 Attribute) |
方法
| 名稱 | Description |
|---|---|
| Equals(Object) |
傳回值,這個值表示這個實例是否等於指定的物件。 (繼承來源 Attribute) |
| GetHashCode() |
傳回這個實例的哈希碼。 (繼承來源 Attribute) |
| GetType() |
取得目前實例的 Type。 (繼承來源 Object) |
| IsDefaultAttribute() |
在衍生類別中覆寫時,指出這個實例的值是否為衍生類別的預設值。 (繼承來源 Attribute) |
| Match(Object) |
在衍生類別中覆寫時,傳回值,指出這個實例是否等於指定的物件。 (繼承來源 Attribute) |
| MemberwiseClone() |
建立目前 Object的淺層複本。 (繼承來源 Object) |
| ToString() |
傳回表示目前 物件的字串。 (繼承來源 Object) |