提供两种方法,第一种可以通过调用API函数实现关机功能,第二种可以使用我前几篇提到的调用CMD执行代码的功能通过shutdown命令关机 代码如下: using System;using System.Collections.Generic;using System.Text;using System.Runtime.InteropServices;namespace ZHWTools 使用时只要用ZHWTools.CloseWin.closeWindow(); 相关文章: