标题:126邮箱自动登陆程序
只看楼主
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5807
专家分:108
注 册:2005-4-7
结帖率:75%
 问题点数:0 回复次数:12 
126邮箱自动登陆程序
根据自己的需求改下。
可可以做成固定网页表单输入程序,如果没有验证码的话.....


    Dim g_oIE As InternetExplorer

Private Sub Combo1_Click()
'MsgBox "aaa"
    Select Case Combo1.Text
        Case "1@
            Label1.Caption = "邮箱一!"
        Case "2@
            Label1.Caption = "邮箱二!"
        Case "3@
            Label1.Caption = "邮箱三!"
        Case "4@
            Label1.Caption = "邮箱四!"
        Case "5@
            Label1.Caption = "邮箱五!"
        
        Case "6@
            Label1.Caption = "邮箱六!"
        Case "7@
            Label1.Caption = "邮箱七!"
    End Select
End Sub



Private Sub Command1_Click()

    Dim vPost As Variant
    Dim vHeaders As Variant
    Set g_oIE = New InternetExplorer
    g_oIE.Visible = True
    ReDim aByte(0) As Byte
   
    Select Case Split(Combo1.Text, "@")(0)
        Case "1"
            pass = "1"
        Case "2"
            pass = "2"
        Case "3"
            pass = "3"
        Case "4"
            pass = "4"
        Case "5"
            pass = "5"
        Case "6"
            pass = "6"
        Case "7"
            pass = "7"
    End Select
   
    cPostData = "user=" + Split(Combo1.Text, "@")(0) + "&pass=" + pass + "&cookietime=0"
    PackBytes aByte(), cPostData
    vPost = aByte
    vHeaders = "Content-Type: application/x-www-form-urlencoded" + Chr(10) + Chr(13)
    g_oIE.Navigate "http://entry., , , vPost, vHeaders
End Sub

Private Sub PackBytes(ByteArray() As Byte, ByVal PostData As String)
Dim iNewBytes As Integer
Dim i As Integer, j As Integer, ch As String
Dim strHex As String
    iNewBytes = LenB(StrConv(PostData, vbFromUnicode)) - 1
    If iNewBytes < 0 Then Exit Sub
    ReDim ByteArray(iNewBytes) As Byte
    For i = 0 To Len(PostData) - 1
        ch = Mid(PostData, i + 1, 1)
        If ch = "" Then
            ch = "+"
            ByteArray(j) = Asc(ch)
        ElseIf Asc(ch) < 0 Then
            ByteArray(j) = CByte("&H" & Left(Hex(Asc(ch)), 2))
            j = j + 1
            ByteArray(j) = CByte("&H" & Right(Hex(Asc(ch)), 2))
        Else
            ByteArray(j) = Asc(ch)
        End If
        j = j + 1
    Next
End Sub


Private Sub Form_Load()
    Combo1.Clear
    Combo1.AddItem ("1@)
    Combo1.AddItem ("2@)
    Combo1.AddItem ("3@)
    Combo1.AddItem ("4@)
    Combo1.AddItem ("5@)
    Combo1.AddItem ("6@)
    Combo1.AddItem ("7@)
    Combo1.ListIndex = 0
    Label1.Caption = "hxfly --126邮箱自动登陆程序!"
End Sub
搜索更多相关主题的帖子: 126邮箱 自动 登陆 
2008-05-11 19:47
leilei88
Rank: 2
来 自:青岛
等 级:论坛游民
帖 子:217
专家分:27
注 册:2008-3-30
得分:0 
程序提示第一行的g_oIE As InternetExplorer这一句,编译错误:用户定义类型未定义。。
2008-05-11 20:08
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5807
专家分:108
注 册:2005-4-7
得分:0 
引用INTERNET控件.....

2008-05-11 21:10
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5807
专家分:108
注 册:2005-4-7
得分:0 
工程--引用---microsoft internet controls

把自己的邮箱名称和密码写到代码中

2008-05-11 21:12
leilei88
Rank: 2
来 自:青岛
等 级:论坛游民
帖 子:217
专家分:27
注 册:2008-3-30
得分:0 
哦~会了,要添加一个引用啊
2008-05-11 21:12
leilei88
Rank: 2
来 自:青岛
等 级:论坛游民
帖 子:217
专家分:27
注 册:2008-3-30
得分:0 
你不早说。。害的我花那么长时间找原因。。
2008-05-11 21:17
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5807
专家分:108
注 册:2005-4-7
得分:0 
晕.....呵呵,我以为一看就能看出来呢,看变量类型不就是VB默认中没有的吗?看英文名字就是互联网浏览器空间啊,呵呵

2008-05-11 21:23
ouzhiguang
Rank: 1
来 自:湖南长沙
等 级:新手上路
威 望:1
帖 子:240
专家分:0
注 册:2007-5-18
得分:0 
实现这个功能,用 webbrows控件,代码更加简单!
2008-05-12 16:43
wen3988
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2008-5-18
得分:0 
支持下~~~~~~~~~
2008-05-18 21:33
duanzelong
该用户已被删除
得分:0 
提示: 作者被禁止或删除 内容自动屏蔽
2008-06-04 19:29



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-213765-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.299886 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved