Sorry, I said I wanted to send the source code last night, but because the girl who rented the master bedroom of the same house went home for the new year, it seems that the route power was disconnected and not sent to the Internet. In fact, the first open-source project has basically completed the basic functions, but it only requires a little modification. If I have time, I will write down how to use tessocr and extendedwebbrowser.
Today, the new version of the game is going to be online and busy with bug changes. We will go home from the office at, and now we have BT5 installed. We will use the wireless next door to get the source code online.
Source code threw on codeplex http://book12306ticket.codeplex.com/
In this way, I can modify the information in the office. I have no time to organize a third-party class and directly threw it into the bin. I uploaded my own ref.
TheCodeAll source projects on the Internet
It took less than two hours to piece it together.ProgramYou can perform all the operations from login to payment within two minutes.
Below is the text
Problems to be Solved:
1. Login Failed
2. You cannot submit the order after logging on.
3. If the payment is unsuccessful after the order is submitted, log on again.
Start solving the problem:
First, we need to implement all the procedures from login to ticket booking, and implement them automatically. An open-source project on codeplex from login to ticket booking
Trainsearch http://myticketsearch.codeplex.com/basic implementation and combined with the webbrowser space can be successfully logged on after sharing a session, the web page does not need to log on again.
However, this project is not automated. You need to manually enter the verification code.
So my initial modification was to use tessocr verification code recognition (using tessocr by Java booking open source project inspired http://code.google.com/p/go-home/ )
After that, I found a bug that someone did not refresh the verification code (although I had known this bug but did not expect that they did not fix it for six months). So I modified the logic of the Code and requested a verification code.
This solves the first two problems.
The last problem is that you have to log on again after payment.
In addition, the session we maintain in webbrowser will pop up a new ie window because the "online payment" button is target = "_ blank", and the session we maintain in webbrowser cannot be passed.
Here we need not pop up ie so we use another open source project extendedwebbrowser http://www.codeproject.com/KB/cpp/ExtendedWebBrowser.aspx
In this way, the session problem is solved. You do not need to log on to the broken web page and directly use a program to solve the following program.