版主,这是我修改的代码,没有成功,请指教,谢谢!
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), 历史 C(6), 地理 C(6), 加试分 C(6), 总分 C(6))
CREATE CURSOR hhh (考生号 C(14), 准考号 C(9), 身分证号 C(18))
INSERT INTO hhh VALUES ("16511801162617","180190219","513901199702272318")
INSERT INTO hhh VALUES ("16511801162640","180180705","513901199707036429")
INSERT INTO hhh VALUES ("16511801162623","180180516","513901199702166419")
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":"], ["]),;
STREXTRACT(szData, [历史","QValue":"], ["]),;
STREXTRACT(szData, [地理","QValue":"], ["]),;
STREXTRACT(szData, [加试分","QValue":"], ["]),;
STREXTRACT(szData, [总分","QValue":"], ["]))
ENDIF
ENDFUNC