Use C# to achieve the effect of WeChat QQ automatically and quickly sending information (swipe the screen)

Table of contents

materials used

Specific ideas

programming

code rendering

Instructions

 the last point


materials used

        Visual Studio 2019

        C# Windows desktop application development function

Specific ideas

        Originally, I planned to use some WeChat interfaces, but found that the steps were complicated (and expensive). So, I changed the road and used the ideas of copying and pasting and keyboard monitoring.

        First look at the usage of the clipboard (Clipboard), I will list it directly:

Clipboard.SetText(String i) - set the currently pasted content

Clipboard.SetImage(Image i) - set the currently pasted image

Clipboard.Clear() - clear the clipboard        

       The codes in red are required by the program, and the rest of the codes can be used to supplement the program.

        For example: You can refresh the screen with pictures.

        Then, let’s talk about keyboard monitoring, let’s talk about what this program needs:

SendKeys.Send(String keys)——simulate a keyboard input

        Of course, you also need to know how to paste and send:

        Paste: Ctrl+V——^{V}

        Send: Enter key——{Enter} (My computer WeChat is like this, it can be changed if it is different) 

Putting "{ }" outside means a key! ! !

         

programming

        First open a C# desktop project

Then there is the program layout:
 

need a timer

 The red ones are their names!

code rendering

        First upload the code:

using System;
using System.Windows.Forms;

namespace WeChat_QQ_AttackOthers
{
    public partial class Form1 : Form
    {
        int num = 0;
        public Form1()
        {
            InitializeComponent();
            
        }

        private void Button_Click(object sender, EventArgs e)
        {
            try
            {
                if (Button.Text == "开始")
                {
                    Clipboard.SetText(Content.Text);
                    Button.Text = "结束";
                    Frequency.Enabled = false;
                    System.Threading.Thread.Sleep(2500);
                    Timer.Interval = int.Parse(Gate.Text);
                    Timer.Enabled = true;
                    Timer.Start();
                }
                else
                {
                    Frequency.Enabled = true;
                    Timer.Enabled = false;
                    Timer.Stop();
                }
            }catch (Exception s)
            {
                MessageBox.Show(s.ToString());
            }
            
        }

        private void Timer_Tick(object sender, EventArgs e)
        { 
            num++;
            SendKeys.Send("^{V}");
            SendKeys.Send("{ENTER}");
            if (num == Frequency.Value)
            {
                Frequency.Enabled = true;
                Timer.Enabled = false;
                Timer.Stop();
                Button.Text = "开始";
                num = 0;
            }
        }

        private void Frequency_Scroll(object sender, EventArgs e)
        {
            Number.Text = Frequency.Value.ToString();
        }

        private void Gate_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if (Gate.Text != "")
                {
                    if (int.Parse(Gate.Text) < 200)
                    {
                        Button.Text = "太快了,太爽了,缓不过来,最小大于200ms";
                    }
                    else
                    {
                        Button.Text = "开始";
                    }
                }
            }catch (Exception s)
            {
                MessageBox.Show(s.ToString());
            }
            
            
        }
    }
}

        Here I wrap everything in Try, mainly because I am lazy.

        I also limited the sending speed, which is greater than or equal to 200ms, which is too fast for WeChat to respond.

Instructions

        Fill in what should be filled, click "Start", and quickly point the mouse pointer to the input box, there is a buffer time of 2.5s.

        Then just watch them treat you (kick out the group) as the boss! ! !

        

 the last point

        I will upload the project engineering and final program of this software to the resources.

        Note: Sending too fast will cause network congestion, making it impossible to send messages. (It seems okay to post a picture, I found it by accident when I was harassing others at night)

        This can also send pictures, voice, video, etc., I will add it slowly (hhh)

        Let's make progress together

Guess you like

Origin blog.csdn.net/LBCLBC666/article/details/126282305