2013-05-15 23 views
1

要禁用安全檢查我應該設置什麼? SuppressUnmanagedCodeSecurityAttributeSuppressUnmanagedCodeSecuritySuppressUnmanagedCodeSecurity或SuppressUnmanagedCodeSecurityAttribute?

哪個這些版本是corrrect?

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

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

回答

3

都做同樣的事情。該類被命名爲SuppressUnmanagedCodeSecurityAttribute,但一般標註屬性時,可以省略後綴Attribute