12306网站火车票预定辅助工具 C#源码

fmms 7年前
     12306网站火车票预定辅助工具(抢票器),其实只是做了自动登录和自动抢票两个功能,    <br /> 正常情况下用浏览器手动是很难登成功的,这个你懂的,人太多了,    <br /> 下面源码需要手动输入验证码,半自动登录,利用发包登录,会比用网页登录成功率来得高,    <br />    <br /> 登录后,选择需预定的车票,在填好车票信息后,设置好提交速度,点击提交订单,将自己动开始抢票,直到成功,    <br /> 下单成功后45分钟内付款,这票就是你的啦    <br />    <br /> 全自动登录,我这里也已实现验证码识别,识别率有70%以上吧,    <br /> 祝大家春节快乐!    <br />    <br />    <span style="color:red;">附自动抢票步骤:</span>    <br />    <span style="color:red;">车票预订页面选择车次--预订--填好乘车人信息--在页面输入验证码--在程序界面点击提交订单按钮--然后就不要再去动任何东西,程序会一直自动提交直到抢到票</span>    <br />    <br />    <strong><span style="color:#444444;">完整请看:</span></strong>    <br />    <a href="/misc/goto?guid=4959501016132123008" rel="nofollow" target="_blank">12306网站火车票预定辅助工具 AAuto源码</a>    <br />    <br />    <pre class="brush:c#; toolbar: true; auto-links: false;">import win.ui; import fsys.ini; import web.form; import win.ui.statusbar; import inet.http; import win.cur; import process; /*DSG{{*/ var winform = win.form(parent=...; bottom=626;right=929;border="resizable";text="AAuto Form" ) winform.add( ed_code={ dl=1;bottom=593;right=501;left=438;top=573;z=7;db=1;text="";edge=1;cls="edit" }; static={ dl=1;bottom=594;text="帐号:";left=23;top=578;transparent=1;db=1;right=57;z=2;cls="static" }; static2={ dl=1;bottom=592;text="密码:";left=174;top=576;transparent=1;db=1;right=208;z=4;cls="static" }; static5={ dr=1;bottom=606;color=16711680;text="作者:carl";left=811;notify=1;top=590;font=LOGFONT( underline=1 );transparent=1;db=1;right=864;z=11;cls="static" }; ed_url={ dr=1;dl=1;bottom=22;text="";left=0;dt=1;top=0;z=9;right=929;edge=1;cls="edit" }; static3={ dl=1;bottom=592;text="验证码:";left=327;top=576;transparent=1;db=1;right=372;z=6;cls="static" }; ed_password={ dl=1;bottom=592;right=319;left=210;top=572;text="";z=5;db=1;password=1;edge=1;cls="edit" }; ed_user={ dl=1;bottom=594;text="";left=59;top=574;z=3;db=1;right=168;edge=1;cls="edit" }; picturebox={ dl=1;bottom=596;text="picturebox";left=372;top=574;z=8;db=1;notify=1;right=429;cls="picturebox" }; static4={ dr=1;bottom=587;color=16711680;text="AAuto开发源码";left=811;notify=1;top=572;font=LOGFONT( underline=1 );z=10;db=1;right=896;transparent=1;cls="static" }; wb={ dr=1;dl=1;bottom=560;text="static";left=0;dt=1;top=23;z=1;db=1;right=929;transparent=1;cls="static" } ) /*}}*/  wb=web.form( winform.wb ) wb.noScriptErr=true; wb.NewWindow2=function( ppDisp, Cancel) {     /*弹出新窗口以前触发 */     winform.setTimeout(         function(){             wb.go( wb.translateUrl )         },1     )     return ppDisp, true; /*第二个返回值如果为真,则取消新窗口*/   }  wb.translate = function( url ){     /*解析URL时触发 */     owner.translateUrl = url; }  wb.NavigateComplete2 = function (pDisp, url) {     winform.ed_url.text=wb.location; }  winform.ed_url.wndproc = function(hwnd,message,wparam,lparam){     if (  message == 0x101/*_WM_KEYUP*/ ) {         if ( wparam == 0xD/*_VK_RETURN*/ ) {             wb.go( winform.ed_url.text );         }     } }  winform.ed_code.wndproc = function(hwnd,message,wParam,lParam){     if(message==135 and wParam==13 and #winform.ed_code.text=4){//按回车登录         if(not start()){return false; }         login()     } }  winform.picturebox.oncommand = function(id,event){     downCode() }  //10分钟自动刷新一次,防止cookie失效 var tmId = winform.addtimer(     1000*60*10,     function(hwnd,msg,id,tick){         wb.refresh();     } ) //初始化 load=function(){     ini=fsys.ini("/config.ini")     winform.ed_user.text=ini.read("CON","user"):"";     winform.ed_password.text=ini.read("CON","password"):"";     wb.go(buyUrl)     status=win.ui.statusbar(winform)     status.setText("操作说明:输入验证码按回车登录,点击验证码会重新刷新")     downCode(); } //开始 start=function(){     status.setText("")     user=winform.ed_user.text;     password=winform.ed_password.text;     if(user=="" or password==""){         status.setText("请输入帐号密码")         return false;     }     ini.write("CON","user",user)     ini.write("CON","password",password)     return true; } //下载数据 downData=function(url,postdata){     return win.invoke(         function(url,postdata){             import win;             import inet.http;             http=inet.http()             if(postdata){                 html,msg=http.post(url,postdata);             }else {                 html,msg=http.get(url)             }             http.close()             return html,msg;         } ,url,postdata     ) } //下载验证码 downCode=function(){     imgebuf=downData(codeUrl ++ math.random());     if(imgebuf){         //string.save("/aa.jpg",imgebuf )         winform.picturebox.image=imgebuf;     } } //登录 login=function(){     if(not start()){return false; }     code=winform.ed_code.text;     winform.ed_code.text="";     postdata="loginUser.user_name=" + user + "&nameErrorFocus=&user.password=" + password + "&passwordErrorFocus=&randCode=" + code + "&randErrorFocus="     postUrl="https://dynamic.12306.cn/otsweb/loginAction.do?method=login";     html,msg=downData(postUrl,postdata)     html=string.fromto(html):""     if(string.find(html,"当前访问用户过多")){         status.setText("当前访问用户过多,请稍后重试!")     }elseif(string.find(html,"请输入正确的验证码")){         status.setText("验证码错误")     }elseif(string.find(html,"欢迎您")){         status.setText("登录成功")         wb.refresh();     }else {         status.setText("其他错误")     }     //string.save("/html.html",html )     downCode();     } winform.static4.wndproc = function(hwnd,message,wParam,lParam){     if(message = 0x200/*_WM_MOUSEMOVE*/){         win.cur.setCur(hwndmouse);              //鼠标形状变成手状     } } winform.static4.oncommand = function(id,event){     process.execute("http://www.aau.cn/thread-4850-1-1.html") } winform.static5.wndproc = function(hwnd,message,wParam,lParam){     if(message = 0x200/*_WM_MOUSEMOVE*/){         win.cur.setCur(hwndmouse);              //鼠标形状变成手状     } } winform.static5.oncommand = function(id,event){     process.execute("http://t.qq.com/carlhk") }  math.randomize(tonumber(time())) buyUrl="http://www.12306.cn/mormhweb/kyfw/" codeUrl="https://dynamic.12306.cn/otsweb/passCodeAction.do?rand=lrand&" hwndmouse=win.cur.load(32649/*_IDC_HAND*/)//鼠标形状变成手状句柄 winform.text="12306网站火车票预定辅助工具" winform.show() load(); win.loopMessage(); return winform;</pre>