| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3301 人关注过本帖, 1 人收藏
标题:vfp 如何从这个网上批量查询高考成绩
只看楼主 加入收藏
dzy123
Rank: 8Rank: 8
等 级:蝙蝠侠
威 望:5
帖 子:379
专家分:820
注 册:2013-4-18
收藏
得分:0 
GET /Handler/GetSpcjkHandler.ashx?jsoncallPP=jQuery160009305991125232615_1421147102703&ksh=14511105121960&sfzh=511321199508028064&zkzh=110516320&yzm=%E8%AF%B7%E7%82%B9%E5%87%BB&_=1421147102781 HTTP/1.1
Accept: */*
Referer: http://cx.
Accept-Language: zh-cn
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 3.0.4506.2152; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E)
Accept-Encoding: gzip, deflate
Host: api.
Connection: Keep-Alive



返回
jQuery160009305991125232615_1421147102703({"ResultCode":"00","ResultMsg":"查询成功","QueryKey":"14511105121960","QResults":[{"Name":"姓名","QValue":"宋佳?         "},{"Name":"考生?,"QValue":"14511105121960"},{"Name":"语文","QValue":"98"},{"Name":"数学","QValue":"81"},{"Name":"外语","QValue":"46"},{"Name":"文科综合","QValue":"134"},{"Name":"政治","QValue":"42.0"},{"Name":"历史","QValue":"44.0"},{"Name":"地理","QValue":"48.0"},{"Name":"加试?,"QValue":"0"},{"Name":"总分","QValue":"359"}]})
2015-01-13 20:01
dzy123
Rank: 8Rank: 8
等 级:蝙蝠侠
威 望:5
帖 子:379
专家分:820
注 册:2013-4-18
收藏
得分:0 
GET /Handler/GetSpcjkHandler.ashx?jsoncallPP=jQuery160009305991125232615_1421147102703&ksh=14511105121960&sfzh=511321199508028064&zkzh=110516320&yzm=%E8%AF%B7%E7%82%B9%E5%87%BB&_=1421147102781 HTTP/1.1
Accept: */*
Referer: http://cx.
Accept-Language: zh-cn
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 3.0.4506.2152; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E)
Accept-Encoding: gzip, deflate
Host: api.
Connection: Keep-Alive



返回
jQuery160009305991125232615_1421147102703({"ResultCode":"00","ResultMsg":"查询成功","QueryKey":"14511105121960","QResults":[{"Name":"姓名","QValue":"宋佳?         "},{"Name":"考生?,"QValue":"14511105121960"},{"Name":"语文","QValue":"98"},{"Name":"数学","QValue":"81"},{"Name":"外语","QValue":"46"},{"Name":"文科综合","QValue":"134"},{"Name":"政治","QValue":"42.0"},{"Name":"历史","QValue":"44.0"},{"Name":"地理","QValue":"48.0"},{"Name":"加试?,"QValue":"0"},{"Name":"总分","QValue":"359"}]})
2015-01-13 20:01
dzy123
Rank: 8Rank: 8
等 级:蝙蝠侠
威 望:5
帖 子:379
专家分:820
注 册:2013-4-18
收藏
得分:0 
这是别人弄的代码一点也不会sada能帮下不
2015-01-13 20:02
sdta
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:江苏省连云港市
等 级:版主
威 望:335
帖 子:9841
专家分:27213
注 册:2012-2-5
收藏
得分:0 
有时间再慢慢看吧

坚守VFP最后的阵地
2015-01-13 21:23
吹水佬
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:451
帖 子:10607
专家分:43182
注 册:2014-5-20
收藏
得分:0 
图片附件: 游客没有浏览图片的权限,请 登录注册

程序代码:
DECLARE LONG WSAStartup  IN Ws2_32 LONG, STRING@
DECLARE LONG WSACleanup  IN Ws2_32
DECLARE LONG socket      IN Ws2_32 LONG, LONG, LONG 
DECLARE LONG connect     IN Ws2_32 LONG, STRING@, LONG 
DECLARE LONG send        IN Ws2_32 LONG, STRING@, LONG, LONG 
DECLARE LONG recv        IN Ws2_32 LONG, STRING@, LONG, LONG 
DECLARE LONG closesocket IN Ws2_32 LONG

CREATE CURSOR fff (姓名 C(14), 考生号 C(14), 语文 C(6), 数学 C(6), 外语 C(6), 文科综合 C(6), 政治 C(6), 历史 C(6), 地理 C(6), 加试分 C(6), 总分 C(6))
CREATE CURSOR hhh (考生号 C(14), 准考号 C(9), 身分证号 C(18))
INSERT INTO hhh VALUES ("14511105121960", "110516320", "511321199508028064")
INSERT INTO hhh VALUES ("14511105122044", "110516404", "511321199605129246")
INSERT INTO hhh VALUES ("14511105121997", "110515602", "51132119960218571X")
SCAN
    szGet = 0h474554202F48616E646C65722F4765745370636A6B48616E646C65722E617368783F6A736F6E63616C6C50503D6A517565727931363032303731353130373239303730303438355F31343231313936343333363137266B73683D;
          + hhh.考生号 + 0h2673667A683D;
          + hhh.身分证号 + 0h267A6B7A683D;
          + hhh.准考号 + 0h26797A6D3D254538254146254237254537253832254239254535253837254242265F3D3134323131393634333337323320485454502F312E310D0A;
          + 0h4163636570743A206170706C69636174696F6E2F6A6176617363726970742C202A2F2A3B713D302E380D0A;
          + 0h526566657265723A20687474703A2F2F63782E73636565612E636E2F68746D6C2F474B434A526573756C742E68746D0D0A;
          + 0h4163636570742D4C616E67756167653A207A682D48616E732D434E2C7A682D48616E733B713D302E350D0A;
          + 0h557365722D4167656E743A204D6F7A696C6C612F352E30202857696E646F7773204E5420362E333B2054726964656E742F372E303B2072763A31312E3029206C696B65204765636B6F0D0A;
          + 0h4163636570742D456E636F64696E673A20677A69702C206465666C6174650D0A;
          + 0h486F73743A206170692E73636565612E636E0D0A444E543A20310D0A436F6E6E656374696F6E3A204B6565702D416C6976650D0A0D0A

    _Get(szGet)
ENDSCAN
SELECT fff
BROWSE
CLEAR DLLS
RETURN

FUNCTION _Get(szGet)
    LOCAL i, stWsaData, stSockAddr, szBuffer, hSocket, szData, ddLen
    szData     = ""
    ddLen      = 0  
    stWsaData  = REPLICATE(0h00, 398)
    szBuffer   = REPLICATE(0h00, 2048)
    stSockAddr = 0h020000507D400FD10000000000000000
    WSAStartup(0x202, @stWsaData)
    hSocket = socket(2, 1, 6)
    IF connect(hSocket, @stSockAddr, LEN(stSockAddr)) != -1
        IF send(hSocket, @szGet, LEN(szGet), 0) != -1
            FOR i = 1 TO 10
                ddLen = recv(hSocket, @szBuffer, LEN(szBuffer), 0)
                IF ddLen != -1
                    EXIT
                ENDIF
            ENDFOR
        ENDIF
    ENDIF
    closesocket(hSocket)
    WSACleanup()
    IF ddLen > 0
        szData = STRCONV(LEFT(szBuffer, ddLen), 11)
        szData = SUBSTR(szData, AT("姓名", szData))
        INSERT INTO fff VALUES (STREXTRACT(szData, [姓名","QValue":"], ["]),;
                                STREXTRACT(szData, [考生号","QValue":"], ["]),;
                                STREXTRACT(szData, [语文","QValue":"], ["]),;
                                STREXTRACT(szData, [数学","QValue":"], ["]),;
                                STREXTRACT(szData, [外语","QValue":"], ["]),;
                                STREXTRACT(szData, [文科综合","QValue":"], ["]),;
                                STREXTRACT(szData, [政治","QValue":"], ["]),;
                                STREXTRACT(szData, [历史","QValue":"], ["]),;
                                STREXTRACT(szData, [地理","QValue":"], ["]),;
                                STREXTRACT(szData, [加试分","QValue":"], ["]),;
                                STREXTRACT(szData, [总分","QValue":"], ["]))
    ENDIF
ENDFUNC
2015-01-14 11:56
dzy123
Rank: 8Rank: 8
等 级:蝙蝠侠
威 望:5
帖 子:379
专家分:820
注 册:2013-4-18
收藏
得分:0 
谢谢了解决问题了
2015-01-14 12:10
ILoveVFD
Rank: 3Rank: 3
等 级:论坛游侠
威 望:3
帖 子:218
专家分:147
注 册:2015-5-2
收藏
得分:0 
我也跟着学习了。
2015-05-05 10:49
sylknb
Rank: 4
等 级:贵宾
威 望:14
帖 子:1547
专家分:184
注 册:2006-6-3
收藏
得分:0 
SCAN
    szGet = 0h474554202F48616E646C65722F4765745370636A6B48616E646C65722E617368783F6A736F6E63616C6C50503D6A517565727931363032303731353130373239303730303438355F31343231313936343333363137266B73683D;
          + hhh.考生号 + 0h2673667A683D;
          + hhh.身分证号 + 0h267A6B7A683D;
          + hhh.准考号 + 0h26797A6D3D254538254146254237254537253832254239254535253837254242265F3D3134323131393634333337323320485454502F312E310D0A;
          + 0h4163636570743A206170706C69636174696F6E2F6A6176617363726970742C202A2F2A3B713D302E380D0A;
          + 0h526566657265723A20687474703A2F2F63782E73636565612E636E2F68746D6C2F474B434A526573756C742E68746D0D0A;
          + 0h4163636570742D4C616E67756167653A207A682D48616E732D434E2C7A682D48616E733B713D302E350D0A;
          + 0h557365722D4167656E743A204D6F7A696C6C612F352E30202857696E646F7773204E5420362E333B2054726964656E742F372E303B2072763A31312E3029206C696B65204765636B6F0D0A;
          + 0h4163636570742D456E636F64696E673A20677A69702C206465666C6174650D0A;
          + 0h486F73743A206170692E73636565612E636E0D0A444E543A20310D0A436F6E6E656374696F6E3A204B6565702D416C6976650D0A0D0A

    _Get(szGet)
上述一段代码如何得来?是不是所有考号,身份证号都可以这样写吗?如果含有验证码,哪如何写代码?有没有通用代码吗?


[ 本帖最后由 sylknb 于 2015-5-5 14:56 编辑 ]
2015-05-05 14:53
吹水佬
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:451
帖 子:10607
专家分:43182
注 册:2014-5-20
收藏
得分:0 
回复 18楼 sylknb
那段用内码表示部份是HTTP协议的头部数据。
这类问题纯属个例,毫无通用性。
2015-05-05 15:01
sylknb
Rank: 4
等 级:贵宾
威 望:14
帖 子:1547
专家分:184
注 册:2006-6-3
收藏
得分:0 
以下是引用吹水佬在2015-5-5 15:01:53的发言:

那段用内码表示部份是HTTP协议的头部数据。
这类问题纯属个例,毫无通用性。
对里面有关内容改一下(准考证号,身份证)能否适用于http://cx.中的成绩查询吗?验证码如何写?
2015-05-05 16:29
快速回复:vfp 如何从这个网上批量查询高考成绩
数据加载中...
 
   



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

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