回复 1# m765555
我只给你方法. 不按你的要求来. 你自己下载测试.
#include <file.au3>
Global $url="http://www.jszks.com/data/question/序号.txt"
Global $questionData[5000]
ProgressOn ( "驾校题库获取器", "开始读取数据" , "0%" , 100 , 100 , 16)
For $i=1 To 4951
$questionData[$i]=BinaryToString(InetRead(StringReplace($url,"序号",$i),1+2),4)
$questionData[$i]=StringRegExpReplace($questionData[$i],'{"id":\d+,"question":"',"问题:")
$questionData[$i]=StringReplace($questionData[$i],'","answer":',"答案:")
$questionData[$i]=StringReplace($questionData[$i],'"image"',"图片")
$questionData[$i]=StringReplace($questionData[$i],'"type"',"类型")
$questionData[$i]=StringReplace($questionData[$i],'"item1"','选项1')
$questionData[$i]=StringReplace($questionData[$i],'"item2"','选项2')
$questionData[$i]=StringReplace($questionData[$i],'"item3"','选项3')
$questionData[$i]=StringReplace($questionData[$i],'"item4"','选项4')
$questionData[$i]=StringReplace($questionData[$i],'"explain":"','扩展阅读:')
$questionData[$i]=StringRegExpReplace($questionData[$i],'","explainid":\d+}','')
$progress=Round($i/4951*100,2)
ProgressSet( $progress, $progress & " %")
Next
$questionData[0]=$i
ProgressSet(100 , "完成", "全部完成")
_FileWriteFromArray(@ScriptDir&"\data.txt",$questionData)
ProgressOff()
MsgBox(0,"提示","全部下载完成,请打开data.txt查看")
|