c# - SuppressUnmanagedCodeSecurity 还是 SuppressUnmanagedCodeSecurityAttribute?

标签 c#

要禁用安全检查,我应该设置什么? SuppressUnmanagedCodeSecurityAttribute 还是 SuppressUnmanagedCodeSecurity

以下哪个版本是正确的?

    [DllImport("Native.dll"), SuppressUnmanagedCodeSecurity]
    public static extern void Method(...

    [DllImport("Native.dll"), SuppressUnmanagedCodeSecurityAttribute]
    public static extern void Method(...

最佳答案

两者做同样的事情。该类名为SuppressUnmanagedCodeSecurityAttribute,但在一般注释属性时,可以省略后缀Attribute

关于c# - SuppressUnmanagedCodeSecurity 还是 SuppressUnmanagedCodeSecurityAttribute?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16561270/

相关文章:

c# - 在另一个线程中填充的排序列表

c# - 角色和声明之间的区别

c# - SqlBulkCopy 成功但未插入任何记录

c# - 从 Json 文件中获取选定的结果

c# - 如何使用 C# 在 PC 上模拟 PS4 Controller 的操纵杆?

c# - #pragma warning 禁用代码列表及其含义

c# - 在由以下内容组成的对象上向 List<T> 添加新方法

c# - 在 C# 中将标志枚举转换为另一个标志枚举

c# - 为什么 DataTable.Select 默认对数据进行排序

c# - 无法在 CollectionChanged 事件期间更改 ObservableCollection