//调用打印机 Process printProcess = new Process(); printProcess.StartInfo.FileName = "cmd.exe"; printProcess.StartInfo.Arguments = $"/p \"{filePath}\""; printProcess.StartInfo.CreateNoWindow = true; printProcess.Start();
//获取硬件信息 print(GetCmdInfo("wmic cpu get name"));//CPU信息 print(GetCmdInfo("wmic diskdrive get model"));//硬盘信息 print(GetCmdInfo("wmic memorychip get capacity"));//内存信息(单位KB) print(GetCmdInfo("wmic path win32_videocontroller get name"));//显卡信息
//以下需要管理员权限且会被杀毒软件拦截 GetCmdComd("wmmic process call create shutdown.exe");//关机 GetCmdComd("wmmic process where pic='114514' call terminate");//按进程块号杀进程 GetCmdComd("wmmic process where name='qq.exe' call terminate");//按进程名称杀进程 GetCmdComd(@"wmic process call create 'C:\\QQ.exe'");//按进程路径开进程
模拟键鼠
接着就是获取并模拟键盘鼠标的相关操作了,到这一步就逃不开给Unity的C#加点料了。个人推荐NuGet for Unity,安装Input Simulator。