一、导入外部DLL函数 如[DllImport(“kernel32.dll”)]这叫引入kernel32.dll这个动态连接库。这个动态连接库里面包含了很多WindowsAPI函数,如果你想使用这面的函数,就需要这么引入。举个例子: [DllImport(“kernel32.dll”)] private static extern void FunName(arg,[arg]); extern 作用:标识这个变量或者函数定义在其他文件 ,提示编译器遇到此变量的时,在其他模块里寻找,这里是在提供的动态库里找 示列代码: using System; using System.Text; using System.Runtime.InteropServices; namespace Windows.Help { public partial class SystemInfo { [DllImport("kernel32")] public static extern void GetWindowsDirectory(StringBuilder WinDir, int count);...