日期:2014-05-17 浏览次数:21024 次
using System.Runtime.InteropServices;
namespace cs_ConsoleApplication1
{
class Program
{
[DllImport("user32.dll", EntryPoint="MessageBox")]
public static extern int MessageBoxA(IntPtr hWnd, String text, String caption, uint type);
static void Main(string[] args)
{
MessageBoxA(new IntPtr(0), "Hello!", "caption", 0);
}
}
}
using System.Runtime.InteropServices;
namespace cs_ConsoleApplication1
{
class Program
{
[DllImport("user32.dll", EntryPoint="MessageBoxW")]
public static extern int MessageBoxW(IntPtr hWnd, String text, String caption, uint type);
static void Main(string[] args)
{
MessageBoxW(new IntPtr(0), "Hello!", "caption", 0);
}
}
}