gstsfb123 Posted December 22, 2010 Share Posted December 22, 2010 Ben metin2 adlı oyun için patcher (güncelleme) programı yapıyorum fakat oraya dosyaların kaç kb hızla indirildiğini gösteren bir koda ihtiyacım var . birazdaha geliştirmeye devam edicem dahada yardıma ihtiyacım olabilir. şimdiden teşekkürler. Link to comment Share on other sites More sharing options...
BuqRaHan Posted December 22, 2010 Share Posted December 22, 2010 Kolay gelsin arkadaşım. Konuna salça olmak amaçlı yorum yazmıyorum amacım konuyu bilmememe rağmen sana yardımcı olmak. Öncelikle konu başlığını düzenlemelisin yoksa konun raporlanabilir veya çöp kutusuna taşınabilir. Saygılarımla.. Link to comment Share on other sites More sharing options...
blue_life Posted December 22, 2010 Share Posted December 22, 2010 Incelersin... [codebox]ProgressOn("BlueLife Dosya Indirme Örneği", "Dosya indiriliyor", "0 Bytes",10,10) _BL_DOWNLOAD("http://www.sordum.com/dns_jumper/downloads8.php", @ScriptDir & "\AppAdmin v1.1.zip") If @error Then ProgressSet(0, "0 Bytes", "Dosya Indirilemedi!") Else MsgBox(64, "", "Dosya Indirildi") EndIf ProgressOff() ;~ Global $Form1 = GUICreate("BlueLife Dosya Indirme Örneği", 270, 110) ;~ Global $Progress1 = GUICtrlCreateProgress(10, 20, 250, 25) ;~ Global $Label1 = GUICtrlCreateLabel("0 Bytes", 10, 50, 250, 20) ;~ GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") ;~ GUICtrlSetColor(-1, 0x0000FF) ;~ Global $Start = GUICtrlCreateButton("Başlat", 10, 75, 250, 24) ;~ GUISetState(@SW_SHOW) ;~ #EndRegion ### END Koda GUI section ### ;~ While 1 ;~ $nMsg = GUIGetMsg() ;~ Switch $nMsg ;~ Case -3 ;~ Exit ;~ Case $Start ;~ _BL_DOWNLOAD("http://www.sordum.com/dns_jumper/downloads8.php", @ScriptDir & "\AppAdmin v1.1.zip",$Progress1,$Label1) ;~ If @error Then ;~ GUICtrlSetData($Label1, "Dosya Indirilemedi!") ;~ Else ;~ MsgBox(64,"","Dosya Indirildi") ;~ EndIf ;~ EndSwitch ;~ WEnd Func _BL_DOWNLOAD($BL_URL, $BL_DOWN_FILE, $BL_Percent = "", $BL_Subtext = "", $INET_OPT = 1) Local $TOTAL_BYTE = InetGetSize($BL_URL) If @error Or $TOTAL_BYTE = 0 Then Return SetError(1, 0, False) Local $Time = TimerInit() Local $BDOWNLOAD = InetGet($BL_URL, $BL_DOWN_FILE, $INET_OPT, 1), $BDOWNINFO Do $BDOWNINFO = InetGetInfo($BDOWNLOAD) If $BL_Percent = "" And $BL_Subtext = "" Then ;~ ProgressSet((100 / $TOTAL_BYTE) * $BDOWNINFO[0], "Inen: " & _BYTES($BDOWNINFO[0])) ProgressSet((100 / $TOTAL_BYTE) * $BDOWNINFO[0], "Inen: " & _BYTES($BDOWNINFO[0]) & @CRLF & "Hız: " & _ StringFormat("%.3f", ($BDOWNINFO[0] / 1024) / ((TimerDiff($Time) / 1000))) & " KB/Sec") Else GUICtrlSetData($BL_Percent, (100 / $TOTAL_BYTE) * $BDOWNINFO[0]) GUICtrlSetData($BL_Subtext, _BYTES($BDOWNINFO[0])) EndIf Sleep(50) Until $BDOWNINFO[2] If FileGetSize($BL_DOWN_FILE) = 0 Then Return SetError(2, 0, False) Return True EndFunc ;==>_BL_DOWNLOAD Func _BYTES($BYTES) If $BYTES >= 1073741824 Then Return Round($BYTES / 1073741824, 2) & " GB" If $BYTES >= 1048576 Then Return Round($BYTES / 1048576, 2) & " MB" If $BYTES >= 1024 Then Return Round($BYTES / 1024, 2) & " KB" If $BYTES < 1024 Then Return $BYTES & " Bytes" EndFunc ;==>_BYTES[/codebox] Link to comment Share on other sites More sharing options...
gstsfb123 Posted December 22, 2010 Author Share Posted December 22, 2010 teşekkürler deniyorum şimdi abicim Allah senden razı olsun ... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.