老刘1号 当前离线
论坛巡查
TOP
pcl_test 当前离线
荣誉版主
/*&cls@echo offset "netpath=%systemroot%\Microsoft.NET\Framework"for /f "delims=" %%a in ('dir /ad /b "%netpath%\v?.*"') do ( if exist "%netpath%\%%a\csc.exe" ( set "cscpath=%netpath%\%%a\csc.exe" goto :0 ))echo;未安装.Net Framework 2.0及其上版本组件或相关程序丢失&pause&exit/b:0"%cscpath%" /out:"$BlockInput.exe" "%~f0""$BlockInput.exe"pause&exit*/using System;using System.Threading;using System.Runtime.InteropServices;class BlockUserInput{ [DllImport("user32.dll")] static extern bool BlockInput(bool BlockIt); static void Main(string[] args) { if(args.Length<1){ Console.WriteLine("Blocks keyboard and mouse input events.\r\n"+ "Usage:\r\n$BlockInput.exe seconds //The valid range is 0 ~ 86400."); Thread.Sleep(2000); }else{ try{ int num = Convert.ToInt32(args[0].ToString()); if(num>=0 && num<=86400){ Console.WriteLine("Blocking..."); BlockInput(true); Thread.Sleep(num*1000); }else Console.WriteLine("Input out of range."); }catch{Console.WriteLine("Enter an integer between 0 and 86400.");} } }}COPY
评分人数
#NoEnv#NoTrayIconif A_OSVersion in WIN_8,WIN_8.1{MsgBox ,,提示,暂不支持Win8及以上系统,10ExitApp}Else{BlockInput,On ;由于 Windows API 的特性,按下 Ctrl+Alt+Del 将重新启用输入sleep,%1%000BlockInput,Off}COPY
CrLf 当前离线