| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3301 人关注过本帖, 1 人收藏
标题:vfp 如何从这个网上批量查询高考成绩
只看楼主 加入收藏
取消关键字高亮
吹水佬
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:451
帖 子:10607
专家分:43182
注 册:2014-5-20
收藏
得分:0 
回复 20楼 sylknb
纯属个例,无通用性。
肯定不适用
2015-05-05 19:26
mywisdom88
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:191
帖 子:3147
专家分:8408
注 册:2015-3-25
收藏
得分:0 
VB6.0 中,用WEB控件,可以做成通用的,但不知道VFP中能不能用WEB控件,不知道用法是不是一样的
2015-05-12 10:56
mywisdom88
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:191
帖 子:3147
专家分:8408
注 册:2015-3-25
收藏
得分:0 
Dim NowTime
Dim ReFreshWorld As Integer
Dim SL As Integer
Dim JY As Integer
Dim SLID As Integer
Dim JYID As Integer
Dim Gold As Integer
Dim Reward As Integer
Dim Num1 As Integer
Dim Num2 As Integer
Dim Num3 As Integer
Dim NumSL As Integer
Dim NumJY As Integer
Dim NumAll As Integer
Dim Cure As Integer
Dim Fight As Integer
Dim OldReward As Integer
Dim S1 As String
Public NowH As Integer
Public NowM As Integer
Public NowS As Integer
Public ShowM As String
Public ShowS As String
Public ReadTime As Boolean
Public NumSolInitial
Public NumSolNow
Public GetName
Public Rank





Private Sub Command1_Click()
    WebBrowser1.Stop
End Sub

Private Sub Command2_Click()
    Timer3.Enabled = True
    Label12.Caption = "挂机成功,20:55后自动运行挂"
End Sub

Private Sub Form_Load()
   
    Timer1.Enabled = False
    Timer2.Enabled = True
    Timer2.Interval = 1000
    Timer3.Enabled = False
    Timer3.Interval = 5000
    Label10.Caption = "当前时间:  " & Time()
    Option1.Value = True
    ReadTime = False
    Combo1.Clear
    For i = 0 To 10
        Combo1.AddItem i
    Next
    Combo1.Text = Combo1.List(2)
End Sub

Private Sub StartWorld_Click()
   
    WebBrowser1.Navigate ("http://wap.)
   
End Sub

Private Sub Timer1_Timer()
    WebBrowser1.Navigate ("http://wap.)
End Sub

Private Sub Timer2_Timer()
    Label10.Caption = "当前时间:  " & Time()
End Sub

Private Sub Timer3_Timer()
    If Time > "20:55" Then
        WebBrowser1.Navigate ("http://wap.)
        Label12.Caption = ""
        Timer3.Enabled = False
    End If
   
End Sub

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
   
    Timer1.Enabled = False
    Timer1.Enabled = True
    Timer1.Interval = Val(Combo1.Text) * 1000
   
    Set Doc = WebBrowser1.Document
   
    Select Case WebBrowser1.LocationURL
        Case "http://wap.
        Timer1.Enabled = False
        For i = 0 To Doc.All.length - 1
            If (LCase(Doc.All(i).tagName)) = "input" Then
                If LCase(Doc.All(i).Name) = "id" Then Doc.All(i).Value = "zjh0001"
                If LCase(Doc.All(i).Name) = "pass" Then Doc.All(i).Value = "zjh123456"
                If LCase(Doc.All(i).Name) = "district" Then Doc.All(i).Value = 16
                If LCase(Doc.All(i).Type) = "submit" Then
                    Doc.All(i).Click
                    Exit For
                End If
            End If
        Next i
        
        Case "http://wap.
            
            Dim m As Integer
            Dim n As Integer
            m = InStr(1, WebBrowser1.Document.All(i).outerHTML, "前往世界")
            n = InStr(1, WebBrowser1.Document.All(j).outerHTML, "的城池")
            If m > 0 And n > 0 Then GetName = Mid(WebBrowser1.Document.All(i).outerHTML, m + 12, n - m - 12)
            
            WebBrowser1.Navigate ("http://wap.)
              
        
            
        Case "http://wap.
            
               
            Cure = InStr(1, WebBrowser1.Document.All(i).outerHTML, "兵力恢复")
            Num1 = InStr(1, WebBrowser1.Document.All(i).outerHTML, "剩余兵队")
            Num2 = InStr(1, WebBrowser1.Document.All(i).outerHTML, "攻击加成")
            Num3 = InStr(1, WebBrowser1.Document.All(i).outerHTML, "剩余红包")
            num4 = InStr(1, WebBrowser1.Document.All(i).outerHTML, GetName)
            
            If num4 > 0 Then
                If Val(Mid(WebBrowser1.Document.All(i).outerHTML, num4 - 15, 1)) > 0 Then
                    Rank = "世界军团排名: " & Val(Mid(WebBrowser1.Document.All(i).outerHTML, num4 - 15, 3))
                ElseIf Val(Mid(WebBrowser1.Document.All(i).outerHTML, num4 - 14, 1)) > 0 Then
                    Rank = "世界军团排名: " & Val(Mid(WebBrowser1.Document.All(i).outerHTML, num4 - 14, 2))
                Else
                    Rank = "世界军团排名: " & Val(Mid(WebBrowser1.Document.All(i).outerHTML, num4 - 13, 1))
                End If
            End If
            Label11.Caption = Rank
            SL = InStr(1, WebBrowser1.Document.All(i).outerHTML, "首领")
            JY = InStr(1, WebBrowser1.Document.All(i).outerHTML, "精英")
            
            If Num1 > 0 And Num2 > 0 Then S1 = Mid(WebBrowser1.Document.All(i).outerHTML, Num1, Num2 - Num1 - 5)
            Reward = Val(Mid(WebBrowser1.Document.All(i).outerHTML, Num3 + 5, 3))
           
            
        
            
            If Reward - OldReward = 4 Then
                NumSL = NumSL + 1
                NumAll = NumAll + 1
                List1.AddItem Time & "  " & "攻打首领,获得4个红包"
               
            ElseIf Reward - OldReward = 2 Then
                NumJY = NumJY + 1
                NumAll = NumAll + 1
                List1.AddItem Time & "  " & "攻打精英,获得2个红包"
            ElseIf Reward - OldReward = 1 Then
                NumAll = NumAll + 1
                List1.AddItem Time & "  " & "攻打普通,获得1个红包"
            End If
            OldReward = Reward
            Label2.Caption = "当前" & S1
            Label3.Caption = "共有红包数量: " & Reward
            Label4.Caption = "总共攻打次数: " & NumAll
            Label5.Caption = "攻打首领次数: " & NumSL
            Label6.Caption = "攻打精英次数: " & NumJY
            
            
            
            
            If SL > 0 Then SLID = Mid(WebBrowser1.Document.All(i).outerHTML, SL - 3, 1)
            If JY > 0 Then JYID = Mid(WebBrowser1.Document.All(i).outerHTML, JY - 3, 1)
            If Cure > 0 Then
                WebBrowser1.Navigate ("http://wap.)
                Exit Sub
            End If
               
            If SL > 0 Then
                WebBrowser1.Navigate ("http://wap. & SLID)
                Exit Sub
            ElseIf JY > 0 Then
                If Option1.Value = False Then
                   WebBrowser1.Navigate ("http://wap.)
                   List1.AddItem Time & "  " & "花10金刷新首领"
                   Gold = Gold + 10
                   Label7.Caption = "总共花费金币: " & Gold
                   Exit Sub
                Else
                    WebBrowser1.Navigate ("http://wap. & JYID)
                    Exit Sub
                End If
            Else
                If Option3.Value = True Then
                   WebBrowser1.Navigate ("http://wap.)
                   List1.AddItem Time & "  " & "花10金刷新精英"
                   Gold = Gold + 10
                   Label7.Caption = "总共花费金币: " & Gold
                   Exit Sub
                Else
                   WebBrowser1.Navigate ("http://wap.)
                    
                    Exit Sub
                End If
            End If
            Case Else
                WebBrowser1.Navigate ("http://wap.)
            
    End Select
End Sub

2015-05-12 11:09
mywisdom88
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:191
帖 子:3147
专家分:8408
注 册:2015-3-25
收藏
得分:0 
以下部分,就是自动登录网站,读取网站内容的,用WEB控件,我们现在玩的1个游戏,网页板的,自己做的挂
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
   
    Timer1.Enabled = False
    Timer1.Enabled = True
    Timer1.Interval = Val(Combo1.Text) * 1000
   
    Set Doc = WebBrowser1.Document
   
    Select Case WebBrowser1.LocationURL
        Case "http://wap.
        Timer1.Enabled = False
        For i = 0 To Doc.All.length - 1
            If (LCase(Doc.All(i).tagName)) = "input" Then
                If LCase(Doc.All(i).Name) = "id" Then Doc.All(i).Value = "zjh0001"
                If LCase(Doc.All(i).Name) = "pass" Then Doc.All(i).Value = "zjh123456"
                If LCase(Doc.All(i).Name) = "district" Then Doc.All(i).Value = 16
                If LCase(Doc.All(i).Type) = "submit" Then
                    Doc.All(i).Click
                    Exit For
                End If
            End If
        Next i
        
        Case "http://wap.
            
            Dim m As Integer
            Dim n As Integer
            m = InStr(1, WebBrowser1.Document.All(i).outerHTML, "前往世界")
            n = InStr(1, WebBrowser1.Document.All(j).outerHTML, "的城池")
            If m > 0 And n > 0 Then GetName = Mid(WebBrowser1.Document.All(i).outerHTML, m + 12, n - m - 12)
            
            WebBrowser1.Navigate ("http://wap.)
              
        
            
        Case "http://wap.
            
               
            Cure = InStr(1, WebBrowser1.Document.All(i).outerHTML, "兵力恢复")
            Num1 = InStr(1, WebBrowser1.Document.All(i).outerHTML, "剩余兵队")
            Num2 = InStr(1, WebBrowser1.Document.All(i).outerHTML, "攻击加成")
            Num3 = InStr(1, WebBrowser1.Document.All(i).outerHTML, "剩余红包")
            num4 = InStr(1, WebBrowser1.Document.All(i).outerHTML, GetName)
            
            If num4 > 0 Then
                If Val(Mid(WebBrowser1.Document.All(i).outerHTML, num4 - 15, 1)) > 0 Then
                    Rank = "世界军团排名: " & Val(Mid(WebBrowser1.Document.All(i).outerHTML, num4 - 15, 3))
                ElseIf Val(Mid(WebBrowser1.Document.All(i).outerHTML, num4 - 14, 1)) > 0 Then
                    Rank = "世界军团排名: " & Val(Mid(WebBrowser1.Document.All(i).outerHTML, num4 - 14, 2))
                Else
                    Rank = "世界军团排名: " & Val(Mid(WebBrowser1.Document.All(i).outerHTML, num4 - 13, 1))
                End If
            End If
            Label11.Caption = Rank
            SL = InStr(1, WebBrowser1.Document.All(i).outerHTML, "首领")
            JY = InStr(1, WebBrowser1.Document.All(i).outerHTML, "精英")
            
            If Num1 > 0 And Num2 > 0 Then S1 = Mid(WebBrowser1.Document.All(i).outerHTML, Num1, Num2 - Num1 - 5)
            Reward = Val(Mid(WebBrowser1.Document.All(i).outerHTML, Num3 + 5, 3))
           
            
        
            
            If Reward - OldReward = 4 Then
                NumSL = NumSL + 1
                NumAll = NumAll + 1
                List1.AddItem Time & "  " & "攻打首领,获得4个红包"
               
            ElseIf Reward - OldReward = 2 Then
                NumJY = NumJY + 1
                NumAll = NumAll + 1
                List1.AddItem Time & "  " & "攻打精英,获得2个红包"
            ElseIf Reward - OldReward = 1 Then
                NumAll = NumAll + 1
                List1.AddItem Time & "  " & "攻打普通,获得1个红包"
            End If
            OldReward = Reward
            Label2.Caption = "当前" & S1
            Label3.Caption = "共有红包数量: " & Reward
            Label4.Caption = "总共攻打次数: " & NumAll
            Label5.Caption = "攻打首领次数: " & NumSL
            Label6.Caption = "攻打精英次数: " & NumJY
            
            
            
            
            If SL > 0 Then SLID = Mid(WebBrowser1.Document.All(i).outerHTML, SL - 3, 1)
            If JY > 0 Then JYID = Mid(WebBrowser1.Document.All(i).outerHTML, JY - 3, 1)
            If Cure > 0 Then
                WebBrowser1.Navigate ("http://wap.)
                Exit Sub
            End If
               
            If SL > 0 Then
                WebBrowser1.Navigate ("http://wap. & SLID)
                Exit Sub
            ElseIf JY > 0 Then
                If Option1.Value = False Then
                   WebBrowser1.Navigate ("http://wap.)
                   List1.AddItem Time & "  " & "花10金刷新首领"
                   Gold = Gold + 10
                   Label7.Caption = "总共花费金币: " & Gold
                   Exit Sub
                Else
                    WebBrowser1.Navigate ("http://wap. & JYID)
                    Exit Sub
                End If
            Else
                If Option3.Value = True Then
                   WebBrowser1.Navigate ("http://wap.)
                   List1.AddItem Time & "  " & "花10金刷新精英"
                   Gold = Gold + 10
                   Label7.Caption = "总共花费金币: " & Gold
                   Exit Sub
                Else
                   WebBrowser1.Navigate ("http://wap.)
                    
                    Exit Sub
                End If
            End If
            Case Else
                WebBrowser1.Navigate ("http://wap.)
            
    End Select
End Sub
2015-05-12 11:11
mywisdom88
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:191
帖 子:3147
专家分:8408
注 册:2015-3-25
收藏
得分:0 
这个是很老版本的挂,现在新版本的不是用这个网站(http://wap.),而是用(http://wap.),要是谁想研究的,我给你们新版本的 ,可以测试的。看看你们能不能用到VFP上去
2015-05-12 11:15
mywisdom88
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:191
帖 子:3147
专家分:8408
注 册:2015-3-25
收藏
得分:0 
Cure = InStr(1, WebBrowser1.Document.All(i).outerHTML, "兵力恢复")
Num1 = InStr(1, WebBrowser1.Document.All(i).outerHTML, "剩余兵队")
Num2 = InStr(1, WebBrowser1.Document.All(i).outerHTML, "攻击加成")
Num3 = InStr(1, WebBrowser1.Document.All(i).outerHTML, "剩余红包")
Num4 = InStr(1, WebBrowser1.Document.All(i).outerHTML, GetName)
知道VB的人,应该知道,这段,是从网站中,读取这些 "兵力恢复","剩余兵队",字在网站中位置,然后取出里面的信息。
2015-05-12 11:26
mywisdom88
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:191
帖 子:3147
专家分:8408
注 册:2015-3-25
收藏
得分:0 
Select Case WebBrowser1.LocationURL
         Case "http://wap.
         Timer1.Enabled = False
         For i = 0 To Doc.All.length - 1
             If (LCase(Doc.All(i).tagName)) = "input" Then
                 If LCase(Doc.All(i).Name) = "id" Then Doc.All(i).Value = "zjh0001"
                 If LCase(Doc.All(i).Name) = "pass" Then Doc.All(i).Value = "zjh123456"
                 If LCase(Doc.All(i).Name) = "district" Then Doc.All(i).Value = 16
                 If LCase(Doc.All(i).Type) = "submit" Then
                     Doc.All(i).Click
                     Exit For
                 End If
             End If
         Next i
         
         Case "http://wap.

这段,是你考试网上的,登录HTM码,改改,就可以自动登录了。

<div class="detail">
                <div class="item">
                    <label>考生号:</label>
                    <input type="text" id="ksh" maxlength="14" />
                    <span id="kshError">
                        *
                        请输入14位考生号
                    </span>
                </div>
                <div class="item">
                    <label>准考证号:</label>
                    <input type="text" id="zkzh" maxlength="9" />
                    <span id="zkzhError">
                        *
                        请输入9位准考证号
                    </span>
                </div>
                <div class="item">
                    <label>身份证号:</label>
                    <input type="text" id="sfzh" maxlength="18" />
                    <span id="sfzhError">
                        *
                        请输入18位身份证号
                    </span>
                </div>
                <div class="item" id="VCodeDiv" style=" display:none; ">
                    <label>验证码:</label>
2015-05-12 11:35
hu9jj
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:红土地
等 级:贵宾
威 望:400
帖 子:11857
专家分:43421
注 册:2006-5-13
收藏
得分:0 
楼上高人啊!不过楼主可能改不了这段登录的代码,还要努力一段时间才行。

活到老,学到老!http://www.(该域名已经被ISP盗卖了)E-mail:hu-jj@
2015-05-12 14:15
mywisdom88
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:191
帖 子:3147
专家分:8408
注 册:2015-3-25
收藏
得分:0 
其实,源码,也不是我写的,我只是在源码的基础上修改。
这是VB6.0写的。不知道VFP能不能用WEB控件,要是能用的话,估计能改成楼主要的。
2015-05-12 15:53
吹水佬
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:451
帖 子:10607
专家分:43182
注 册:2014-5-20
收藏
得分:0 
WEB控件在VFP的应用不少。
2015-05-12 19:32
快速回复:vfp 如何从这个网上批量查询高考成绩
数据加载中...
 
   



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

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