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 和本地函数。 如果应用于类型或模块,则它适用于嵌套在内部的所有方法。 特意不允许在程序集上使用此属性。 若要将 特性应用于多个类型声明,请在模块级别改用它。
Skip |
初始化 SkipLocalsInitAttribute 类的新实例。 |
Equals(Object) |
返回一个值,该值指示此实例是否与指定的对象相等。 (继承自 Attribute) |
Get |
返回此实例的哈希代码。 (继承自 Attribute) |
Get |
获取当前实例的 Type。 (继承自 Object) |
Is |
在派生类中重写时,指示此实例的值是否是派生类的默认值。 (继承自 Attribute) |
Match(Object) |
当在派生类中重写时,返回一个指示此实例是否等于指定对象的值。 (继承自 Attribute) |
Memberwise |
创建当前 Object 的浅表副本。 (继承自 Object) |
To |
返回表示当前对象的字符串。 (继承自 Object) |
产品 | 版本 |
---|---|
.NET | 5, 6, 7, 8, 9 |