dll声明和调用的例子
// Declare a class member for each structure element.
[ StructLayout( LayoutKind.Sequential )]
public class SystemTime
{
public ushort year;
…
public ushort milliseconds;
}
public class LibWrap
{
// Declare a managed prototype for the unmanaged function.
[ DllImport( "Kernel32.dll" )]
public static extern void GetSystemTime( [In,Out] SystemTime st );
}