C#调用非托管的代码

using System;
using System.Runtime.InteropServices;

namespace 调用非托管项目demo
{
    class Program
    {
        static void Main(string[] args)
        {

            Win32.MessageBox(0, "Hello I am Kun", "stm32", 0);
        }
        public class Win32
        {
            [DllImport("user32.dll", CharSet = CharSet.Auto)]
            public static extern IntPtr MessageBox(int hWnd, String text,String caption, uint type);
        }
    }
}

运行结果:

C#调用非托管的代码

上一篇:将MySQL中的数据导入到solr索引库


下一篇:http协议