自動登錄源碼
① VB 做 QQ自動登錄
'在VB中建一工程,工程名為QQAutoLogin。移除系統自動添加的窗體Form1。在該工程下添加一模塊,模塊名為QQAutoLoginMod。復制以下代碼到模塊中。
Option Explicit
'-----------------------API 定義-------------------------------
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Declare Function GetFocus Lib "user32" () As Long
Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hWnd As Long, lpdwProcessId As Long) As Long
Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Declare Function GetMoleFileNameEx Lib "psapi" Alias "GetMoleFileNameExA" (ByVal hProcess As Long, ByVal hMole As Long, ByVal lpFileName As String, ByVal nSize As Long) As Long
Declare Function IsWindowVisible Lib "user32" (ByVal hWnd As Long) As Long
Declare Function CloseHandle Lib "kernel32.dll" (ByVal hObject As Long) As Long
Declare Function EnumChildWindows Lib "user32" (ByVal hWndParent As Long, ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Declare Function GetClientRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
Declare Function GetClassName Lib "user32.dll" Alias "GetClassNameA" (ByVal hWnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Declare Function GetParent Lib "user32" (ByVal hWnd As Long) As Long
Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
Declare Function SetForegroundWindow Lib "user32" (ByVal hWnd As Long) As Long
'-----------------------結構定義-------------------------------
Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
'-----------------------常量定義-------------------------------
Const WM_SETTEXT = &HC
Const STANDARD_RIGHTS_REQUIRED = &HF0000
Const SYNCHRONIZE = &H100000
Const PROCESS_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED Or SYNCHRONIZE Or &HFFF
Const KEYEVENTF_KEYUP = &H2
Const SW_SHOWNORMAL = 1
Dim QQ_ExeFileName As String 'QQ.exe全路徑文件名
Dim QQ_MainhWnd As Long 'QQ登錄窗口句柄
Dim QQ_NumEdithWnd As Long 'QQ號碼框句柄
Dim QQ_PwdEdithWnd As Long 'QQ密碼柄句柄
Private Function QQ_AutoPressKey(hWnd As Long, strKey As String)
Dim nLength As Long, VKey As Long, i As Long
strKey = UCase(strKey)
nLength = Len(strKey)
For i = 1 To nLength
VKey = Asc(Mid(strKey, i, 1))
Call AutoPressKey(VKey)
Next
End Function
Public Function AutoPressKey(VKey As Long)
keybd_event VKey, 0, 0, 0 '模擬鍵按下
keybd_event VKey, 0, KEYEVENTF_KEYUP, 0 '模擬鍵彈起
End Function
Private Function QQ_GetMainhWnd()
EnumWindows AddressOf QQ_EnumMainhWndProc, 0 '枚舉所有頂層窗口
End Function
Private Function QQ_EnumMainhWndProc(ByVal hWnd As Long, ByVal lParam As Long) As Boolean
Dim nPID As Long, nTID As Long
Dim hProcess As Long, strFileName As String
nTID = GetWindowThreadProcessId(hWnd, nPID) '根據窗口句柄獲得擁有窗口的進程ID和線程ID
hProcess = OpenProcess(PROCESS_ALL_ACCESS, True, nPID) '根據進程ID打開進程獲得進程句柄
strFileName = Space(255)
GetMoleFileNameEx hProcess, 0, strFileName, 255 '根據進程句柄獲得進程主模塊文件名
If Left$(strFileName, InStr(1, strFileName, Chr(0)) - 1) = QQ_ExeFileName Then
If IsWindowVisible(hWnd) Then '整個QQ.exe登錄期間只有登錄窗口是可見的
QQ_MainhWnd = hWnd
QQ_EnumMainhWndProc = False '枚舉函數返回False結束循環枚舉
CloseHandle hProcess
Exit Function
End If
End If
CloseHandle hProcess
QQ_EnumMainhWndProc = True
End Function
Private Function QQ_GetSubhWnd()
EnumChildWindows QQ_MainhWnd, AddressOf EnumSubhWndProc, 0 '枚舉QQ登錄窗口下的所有子窗口
End Function
Private Function EnumSubhWndProc(ByVal hWnd As Long, ByVal lParam As Long) As Long
Dim stRect As RECT, nWidth As Long, nHeight As Long
Dim strClassName As String * 255, tmphWnd As Long
GetClientRect hWnd, stRect '取得窗口客戶區距形區域大小
nWidth = stRect.Right - stRect.Left
nHeight = stRect.Bottom - stRect.Top
strClassName = Space(255)
GetClassName hWnd, strClassName, 255 '根據窗口句柄獲得窗口類名
Select Case Left$(strClassName, InStr(1, strClassName, Chr(0)) - 1)
Case "Edit" '如果該窗口是文本框類
tmphWnd = GetParent(hWnd) '獲得該窗口的父窗口
strClassName = Space(255)
GetClassName tmphWnd, strClassName, 255 '取得父窗口類名
If tmphWnd <> QQ_MainhWnd Then '如果該子窗口的父窗口不是QQ登錄窗口的話
'注意:QQ號碼框被設計在一個ComboBox類的組合框中。
'父子關系如下:QQ登錄窗口__ComboBox(父窗口為QQ登錄窗口)__QQ號碼框(父窗口為ComboBox)
'這種關系在QQ登錄窗口中是唯一的,要查找QQ號碼框要滿足的條件如下:
'1:類名必須是Edit 2:父窗口類名必須是ComboBox
If Left$(strClassName, InStr(1, strClassName, Chr(0)) - 1) = "ComboBox" Then
'加多一層檢查,QQ號碼框的距形大小,這個也是唯一的。
'其實單單檢查這個也可以查找到QQ號碼框
'注意這個會隨著QQ版本的不同可能會有所不同,因為QQ的界面騰迅一直使其在變(漂亮)
If nWidth = 127 And nHeight = 14 Then
QQ_NumEdithWnd = hWnd
End If
ElseIf Left$(strClassName, InStr(1, strClassName, Chr(0)) - 1) = "#32770" Then
'要查找QQ密碼框要滿足的條件如下:
'1:類名必須是Button 2:父窗口類名必須是#32770(對話框)
'注意以上兩個並不是唯一的,必須加多以下一層檢查
If nWidth = 131 And nHeight = 14 Then '單單檢查這個也可以,這個是唯一的(2007版)
QQ_PwdEdithWnd = hWnd
End If
End If
End If
Case "Button"
'If nWidth = 75 And nHeight = 21 Then
'MsgBox "登錄框"
'End If
End Select
EnumSubhWndProc = True
End Function
Public Function QQ_AutoLogin(strExeFileName As String, strNum As String, strPwd As String)
Shell strExeFileName '外部運行QQ.exe
Sleep 1000 '延時1000毫秒
QQ_MainhWnd = 0 '初始化登錄窗口句柄
Call QQ_GetMainhWnd '獲取QQ登錄窗口句柄(自定義函數)
If QQ_MainhWnd Then Debug.Print "成功獲得主窗口句柄" '調試語句,可刪除
QQ_NumEdithWnd = 0 '初始化號碼框和密碼框句柄
QQ_PwdEdithWnd = 0
If QQ_MainhWnd Then Call QQ_GetSubhWnd '獲取QQ號碼框和密碼框句柄(自定義函數)
If QQ_NumEdithWnd And QQ_PwdEdithWnd Then Debug.Print "成功獲得號碼框和密碼框句柄" '調試語句,可刪除
SendMessage QQ_NumEdithWnd, WM_SETTEXT, 0, 0 '清空號碼框
'有人問為什麼不用SetFocus直接設置焦點而用模擬按下Tab鍵,那是因為QQ不響應獲得焦點消息,調用SetFocus達不到效果
'還有一個在QQ登錄窗口Tab鍵只在號碼框和密碼框之間來回切換,不信你試一下
Call SetForegroundWindow(QQ_MainhWnd) '保證模擬鍵盤輸入之前QQ登錄窗口的顯示狀態
If GetFocus() <> QQ_NumEdithWnd Then Call AutoPressKey(vbKeyTab) '保證模擬鍵盤輸入之前焦點在號碼框
Call QQ_AutoPressKey(QQ_NumEdithWnd, strNum) '模擬鍵盤自動輸入QQ號碼
Sleep 500
If GetFocus() <> QQ_PwdEdithWnd Then Call AutoPressKey(vbKeyTab) '保證模擬鍵盤輸入之前焦點在密碼框
Call QQ_AutoPressKey(QQ_PwdEdithWnd, strPwd) '模擬鍵盤自動輸入QQ密碼
Sleep 500
Call AutoPressKey(vbKeyReturn) '模擬鍵盤輸入回車鍵開始登錄
End Function
Sub Main()
Dim strNum As String, strPwd As String
strNum = "4598456"
strPwd = "nihaoma"
QQ_ExeFileName = "D:\Program Files\Tencent\QQ\QQ.exe"
Call QQ_AutoLogin(QQ_ExeFileName, strNum, strPwd) 'QQ自動登錄函數(自定義函數)
End Sub
'程序還有以下幾個致命的缺陷:
'1:如果在該程序運行之前已經有QQ程序在運行(未登錄或已登錄的),那判斷QQ登錄主窗口的代碼就可能會不正確了
'2:模擬鍵盤輸入那地方還有點問題,在模擬的中間有可能被別的程序打斷,一失去焦點就亂了
② 這是網易郵箱自動登錄vbs源碼請問是那出了錯怎麼改
要是有驗證碼的話 你得先過了這關.
沒有驗證碼還比較容易實現,
你能寫出識別他驗證碼的程序嗎?
當然前提你用戶名和密碼要對.
我給你說個思路
父窗口賦值給子窗口文本框,
然後調用子窗口的submit事件,
以前我寫過簡訊炸彈就是這樣子實現的.
③ vb 如何在WebBrowser控制項中修改網頁源碼,達到自動登錄的效果
設置一下
WebBrowser(WebBrowser1)的屬性吧
Private
Sub
Form_Load()WebBrowser1.Navigate
("源碼來源的網址")WebBrowser1 .Document.all("username").value
=
你的賬戶WebBrowser1 .Document.all("password").value
=
你的密碼End
Sub
Private
Sub
Command1_Click()WebBrowser1 .Document.all("submit")。clickEnd
Sub
④ 怎麼寫個vbs可以自動登錄完美國際(求源碼)
這個有點難,模擬輸入要有焦點的,窗口不在前台的話不好弄啊
⑤ 易語言自動登陸游戲的源碼或者思路
後台登陸首先就是封包
你需要先截取到登陸封包並且破解了解其中內容和加密方法
然後將你的用戶名密碼代入加密公式中運算。再將你的用戶密碼通過封包形式發送給伺服器。
伺服器會返回成功登陸數據和大區登陸數據,當登陸器接受到該數據後,通過判斷式呈現到你的登陸器窗口上。
思路而已重要的是,現在的游戲伺服器對這些都有限制的,比如登陸器特徵碼、登陸器的MD5碼==。
⑥ 易語言 自動登錄QQ空間源碼
建議樓主放棄,這類方法只能靠post去模擬瀏覽器動作完成,但大型購物網站伺服器都比較針對性的反這些行為(因為出現過有人寫病毒讓中毒機器自動拍他的東西刷信譽的)使得這些功能實現起來難度極大,建議還是放棄的好。
⑦ 一個CF自動登錄器,求源碼,可以出錢,但是必須能用!
怎麼可能!
自己開發個軟體吧
⑧ 有沒有c語言或c#模擬網頁自動登錄的源代碼
以前試過 好像沒辦法。ajax應該是等頁面載入以後再執行。你可以循環解析源代碼查看是否已經取得ajax部分的代碼
⑨ VB自動登錄網頁,求代碼
添加一個webbrowser控制項,然後在它的complete事件里添加代碼:
DimdAsObject,oAsObject,pcAsString
OnErrorResumeNext
Setd=web.Document
IfdIsNothingThenExitSub
Seto=d.getElementById("username")
o.Value="admin"
Seto=d.getElementById("pwd_")
o.Value="123456"
web.Navigate"javascript:checkLogin();void0"
⑩ php 自動登錄網站並發帖功能怎麼實現,有源碼分享就更好了,謝謝了
先分析要登錄的網站的登錄提交地址,之後用php網頁發送變數到登錄的網站並響應結果,分析網頁,在提交發帖頁面,之後響應發帖頁面,分析發帖頁面,找到提交地址,用php發送變數,就完成發帖了。