1. 调用格式
using System.Runtime.InteropServices; //引用此名称空间,简化后面的代码
// 使用DllImportAttribute特性来引入api函数,声明的是空方法
public static extern ReturnType FuntionName(type arg1, type arg2,……)
调用时与调用其他方法相同
博客介绍了使用DllImportAttribute特性引入api函数的调用格式。需引用System.Runtime.InteropServices名称空间简化代码,声明空方法,调用时与其他方法相同,还给出了参考链接。
1. 调用格式
using System.Runtime.InteropServices; //引用此名称空间,简化后面的代码
// 使用DllImportAttribute特性来引入api函数,声明的是空方法
public static extern ReturnType FuntionName(type arg1, type arg2,……)
调用时与调用其他方法相同
1544

被折叠的 条评论
为什么被折叠?