您的位置:首页 > 编程语言 > C#

C# 调用系统API 内核 简单样例

2015-04-29 10:33 225 查看
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;  //引用系统调用

namespace win32_Api
{
class Program
{
[DllImport("user32.dll")]  //调用内核插件
public static extern int MessageBox(int h, string m, string c, int type); //属性设置

static void Main(string[] args)
{

MessageBox(0, "Hello win32 API", "title", 4); //对应属性中的4个参数 h=0,hello..=m,title=c,type=4
Console.ReadLine();

}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: