using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication2 { class Program { static void Main(string[] args) { PrScrn(); } [DllImport("PrScrn.dll", EntryPoint = "PrScrn")] static extern int PrScrn(); } }
创建用控制台项目,属性中改成 输出为 windows应用程序