本帖最后由 pcl_test 于 2016-4-8 06:30 编辑
- /*&cls
- @echo off
- set "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
- :0
- "%cscpath%" /out:SwapMouseButton.exe "%~f0"
- SwapMouseButton.exe
- pause&exit
- */
- using System;
- using System.Runtime.InteropServices;
- class Program
- {
- //http://blog.csdn.net/bluceyoung/article/details/8582160
- [DllImport("user32.dll")]
- private extern static bool SwapMouseButton(bool fSwap);
-
- static void Main(string[] args)
- {
- if (SwapMouseButton(true))SwapMouseButton(false);
- }
- }
复制代码
|