迅雷开放引擎调用示例-飞外
Local $$tStatus, $$tFileSize, $$tRecvSize, $$iProgress Local $$iStatus, $$iFileSize, $$iRecvSize Sleep(1000) $$tStatus = DllStructCreate("long") $$tFileSize = DllStructCreate("UINT64") $$tRecvSize = DllStructCreate("UINT64") DllStructSetData($$tStatus, 1, -1) DllStructSetData($$tFileSize, 1, 0) DllStructSetData($$tRecvSize, 1, 0) $$aRet = DllCall($$Dll, "DWORD", "XLQueryTaskInfo", "int", $$lTaskId, "long*", _ DllStructGetPtr($$tStatus, 1), "UINT64*", DllStructGetPtr($$tFileSize, 1), "UINT64*", DllStructGetPtr($$tRecvSize, 1)) $$iStatus = $$aRet[2] $$iFileSize = $$aRet[3] $$iRecvSize = $$aRet[4] If $$aRet[0] = 0 Then If 0 $$iFileSize Then $$iProgress = $$iRecvSize / $$iFileSize $$iProgress *= 100 $$iProgress = StringFormat("%.2f%%", $$iProgress) ConsoleWrite($$iProgress @CRLF) Else ConsoleWrite("File size is zero" @CRLF) EndIf If 11 == $$iStatus Then MsgBox(0, "Success", "Download successfully") Exit EndIf If 12 == $$iStatus Then MsgBox(16, "Failed", "Download failed") Exit EndIf EndIf Until $$aRet[0] 0EndFunc
热门阅读
- 龙门古镇在哪里 0人看过
- 鸡蛋里面白色的东西是什么 0人看过
- 金桔核能吃吗 0人看过
- 生姜从地里挖出来后如何储存 0人看过
- 生蚝怎么存放过夜不死 0人看过
- 豆腐长黑毛还可以吃吗? 0人看过
- 3077代表什么 0人看过
- 茶里有咖啡因吗 0人看过
- 车厘子冷藏能放多久 0人看过
- 冬天水管子冻了怎么办 0人看过