C#如何调用API函数
c#中如何调用api函数。
推荐阅读
声明一下即可
[dllimport("kernel32.dll")]
protected static extern uint getlasterror();
http://www.digitalearth.net.cn/gisrelateditissues/csharp/ccapture.htm
还有一定要在开头声明using system.runtime.interopservices ;
像上面一样,声明一下就可以调用了~
http://expert.csdn.net/expert/topic/2065/2065226.xml?temp=.182873
http://www.yesky.com/softchannel/72342380468109312/20020719/1621165.shtml
http://www.yesky.com/softchannel/72342380468109312/20030522/1702593.shtml
public class win32 {
[dllimport("user32.dll", entrypoint="messagebox")]
public static extern int msgbox(int hwnd, string text, string caption, uint type);
}
看看:
<root>\sdk\v1.1\samples\technologies\interop\platforminvoke


讨论区