首页 >> 民生救助

锐利体验六覆盖

民生救助  2021-08-24 13:35 字号: 大 中 小

外部方法

C#引入了extern修饰符来表示外部方法。外部方法是用C#以外的语言实现的方法如Win32 API函数。如前所是外部方法不能是抽象方法。我们看下面的一个例子:

玩家可持续30秒内每秒获得不菲的经验。除了丰厚的经验奖励之外 using System;

using eropServices;

class MyClass

{

[DllImport(\"l\")]

static extern int MessageBoxA(int hWnd, string msg,string caption, int type);

public static void Main()

{

MessageBoxA(0, \"Hello, World!\", \"This is called from a C# app!\", 0);

}

}

程序经编译后执行输出:

这里我们调用了Win32 API函数int MessageBoxA(int hWnd, string msg,string caption, int type)。

查看本文来源

沈阳哪家白癜风好
兰州治妇科医院
武汉包皮过长
推荐资讯