[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
  1. /*&cls
  2. @echo off
  3. set "netpath=%systemroot%\Microsoft.NET\Framework"
  4. for /f "delims=" %%a in ('dir /ad /b "%netpath%\v?.*"') do (
  5.     if exist "%netpath%\%%a\csc.exe" (
  6.         set "cscpath=%netpath%\%%a\csc.exe"
  7.         goto :0
  8.     )
  9. )
  10. echo;未安装.Net Framework 2.0及其上版本组件或相关程序丢失&pause&exit/b
  11. :0
  12. "%cscpath%" /out:"$MonitorOff.exe" "%~f0"
  13. "$MonitorOff.exe"
  14. pause&exit
  15. */
  16. using System;
  17. using System.Runtime.InteropServices;
  18. class MonitorOff
  19. {
  20.     [DllImportAttribute("user32.dll")]
  21.     private static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);
  22.     static void Main(string[] args)
  23.     {
  24.         SendMessage((IntPtr)0xffff, 0x112, 0xF170, 2);
  25.     }
  26. }
复制代码

TOP

返回列表