This is a small Delphi program compiled last year. At that time, a friend from Ningbo asked me to write a software for him. The requirements are as follows: Automatic posting can be implemented in various transaction zones on the XXXX website.
XXXX is a game card transaction site. They divide transaction regions by province. Information publishers can only publish information in one province at a time. Of course, they may also for some purpose, such as preventing information flooding. The publisher's publishing information page has a graphic verification code. The entire process can be completed only by entering the correct verification code.
At that time, he was using it all the time. It is unknown whether or not he is still using it. It is purely a matter of communicating and learning with everyone and not doing anything evil.
Log on to the website, automatically fill in the webpage data, and submit the data. This is a simple function. I would like to give you an example at will:
First, embed a standard webbrowser control in Form (another webbrowser control is used in the program, but can be exchanged), navigate a URL, and then access it through the OLE object.
For example, if there is a button with the ID btnok on the page, you can access it as follows:
Try
O: = embeddedwb1.oleobject.doc ument. All. Item ('btnok', 0 );
O. Click;
Except
Txterror. Caption: = 'no <confirm submission> input location found on the current page. Please check it! ';
End;
The most complicated part is the verification code recognition part:
Thanks to the simple verification code image of this website, it consists of 4 characters. Although there are interference colors, noise, and character sticking, it has a certain degree of rotation, but only a number, there are no letters or Chinese characters. Otherwise, you have to build a complete OCR system.
The image processing process is as follows:
The recognition simulation process is as follows:
Comparison similarity is difficult to identify. I am here to save effort because the image is relatively simple. For more complex image recognition, you can create a mathematical model, make images and templates into a matrix, and compare the similarity based on matrix transformation and rotation. Interested friends can gain a deeper understanding.
I put the source code in the resource. You can download it without splitting. Everyone laughed and wrote dephi7. At that time, the recognition rate was about 80%.