WolfmanTR_ Posted May 28, 2014 Share Posted May 28, 2014 http.download ile yaptığım bir indirmeyi nasıl iptal ederim ? Quote Link to comment Share on other sites More sharing options...
KintaRo Posted May 28, 2014 Share Posted May 28, 2014 şu örnek bir CallBack: function HTTPCallback (nBytesRead, nFileSize, TransferRate, strKbsRate, SecondLeft, SecondLeftFormat) nPercent = Math.Round((nBytesRead/nFileSize)*100,0); ProgressEx.SetRange("ProgressEx1", 0, 100) ProgressEx.SetCurrentPosition("ProgressEx1", nPercent) local strkbs = string.format("%.1f",TransferRate); strKbsRate = strkbs .. " KB/Sn"; ProgressEx.SetText("ProgressEx1", file .. " ~ " .. String.GetFormattedSize(nBytesRead, FMTSIZE_AUTOMATIC, true) .. "/" .. String.GetFormattedSize(nFileSize-nBytesRead, FMTSIZE_AUTOMATIC, true) .." ~ " .. strKbsRate .. " ~ " .. SecondLeft .. " ~ " .. nPercent .. "%") return devamet; end bir HTTP.Download() isteğini bu callback ile çalıştırdığınız zaman, download esnasında her hangi bir buttona yazdığınız: devamet = false; kodu çalıştığında download iptal edilecektir. Quote Link to comment Share on other sites More sharing options...
milano88 Posted May 28, 2014 Share Posted May 28, 2014 AMS' de "Hidden Global Functions" var HTTP.Download() için if ( gCancel_Download ) then return false; else return true; end gCancel_Download = true; yaparsanız indirme iptal olur... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.