Used to indicate that a method in P/Invoke method implemented in unmanaged code. The attribute provides the name of the file (DllName) and the name of the method within that file (EntryPoint) where the implementation can be found.
Object
Attribute
DllImportAttribute
[Visual Basic] Public Class DllImportAttribute Inherits Attribute [C#] public class DllImportAttribute : Attribute [C++] public __gc class DllImportAttribute : public Attribute [JScript] public class DllImportAttribute extends Attribute
Can be used to attribute methods.
Namespace: System.Runtime.InteropServices
Assembly: mscorlib.dll
[C#]
[DllImport(KERNEL32, EntryPoint="MoveFile", SetLastError=true, CharSet=CharSet.Auto, ExactSpelling=true, CallingConvention=StdCall)] public static extern bool MoveFile(String src, String dst);
DllImportAttribute Members | System.Runtime.InteropServices Namespace