|  | 
 
| 复制代码using System.Text;
using System.Runtime.InteropServices;
public class api
{
    [DllImport("user32.dll", EntryPoint = "MessageBox")]
    public static extern int MsgBox(int hWnd, String text, String caption, uint type);
    [DllImport("kernel32.dll")]
    public static extern int GetShortPathName(string path, StringBuilder shortPath, int shortPathLength);
}
调用:api.MsgBox(0, "a", "b", 64);
 | 
 |