Il me faut une jauge

Résolu
PSPCRACK Messages postés 11 Date d'inscription vendredi 16 décembre 2005 Statut Membre Dernière intervention 27 décembre 2005 - 26 déc. 2005 à 13:32
cs_DARKSIDIOUS Messages postés 15814 Date d'inscription jeudi 8 août 2002 Statut Membre Dernière intervention 4 mars 2013 - 26 déc. 2005 à 16:50
Salut
j'ai un problème, je voudrais une jauge qui évolue toute seule
par rapport a un transfert de fichier et qui affiche le temps restant
merci d'avance
<HR>
psp: j'ai 13ans

5 réponses

cs_DARKSIDIOUS Messages postés 15814 Date d'inscription jeudi 8 août 2002 Statut Membre Dernière intervention 4 mars 2013 130
26 déc. 2005 à 16:50
Voir ma source de copie de dossier avec défillement, elle te
permettra d'avoir la progression de la copie avec plusieurs affichage
possible

_____________________________________________________________________
DarK Sidious

Un API Viewer (pour le VB, VB.NET, C, C# et Delphi) tout en français : www.ProgOtoP.com/popapi/
3
AnteManoclis Messages postés 154 Date d'inscription jeudi 22 mai 2003 Statut Membre Dernière intervention 6 septembre 2007
26 déc. 2005 à 13:58
Salut, le transfert de fichiers, tu le réalises comment ?


Tchô
AnteManoclis
0
PSPCRACK Messages postés 11 Date d'inscription vendredi 16 décembre 2005 Statut Membre Dernière intervention 27 décembre 2005
26 déc. 2005 à 14:08
je le réalise par
visualbasic.scriptingobject

mon code est
set fso=createobject......
fso copyfile "chemin source","chemin de destination"

merci
0
AnteManoclis Messages postés 154 Date d'inscription jeudi 22 mai 2003 Statut Membre Dernière intervention 6 septembre 2007
26 déc. 2005 à 15:24
Alors là, j'sais pas, j'sais pas comment fonctionne cette fonction
mais, ce qu'il faudrait réussir à récupérer, c'est la taille du fichier
à transférer, le nombre d'octets envoyés entre deux trames et ça
devrait suffir, maintenant, peut-on les retrouver....?



Bon courage

Tchô
AnteManoclis
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
BasicInstinct Messages postés 1470 Date d'inscription mardi 5 février 2002 Statut Membre Dernière intervention 20 octobre 2014 12
26 déc. 2005 à 16:03
'lut

utilises plutot l'api CopyFileEx


exemple tiré de l'API-Guide:

'in a form (Form1)
Private Sub Form_Load()
'KPD-Team 2001
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
Dim Ret As Long
'set the graphics mode to persistent
Me.AutoRedraw = True
'print some text
Me.Print "Click the form to abort the filecopy"
'show the form
Me.Show
'start copying
Ret = CopyFileEx("c:\verybigfile.ext", "c:\copy.ext", AddressOf CopyProgressRoutine, ByVal 0&, bCancel, COPY_FILE_RESTARTABLE)
'show some text
Me.Print "Filecopy completed " + IIf(Ret = 0, "(ERROR/ABORTED)", "successfully")
End Sub
Private Sub Form_Click()
'cancel filecopy
bCancel = 1
End Sub
'in a module
Public Const PROGRESS_CANCEL = 1
Public Const PROGRESS_CONTINUE = 0
Public Const PROGRESS_QUIET = 3
Public Const PROGRESS_STOP = 2
Public Const COPY_FILE_FAIL_IF_EXISTS = &H1
Public Const COPY_FILE_RESTARTABLE = &H2
Public Declare Function CopyFileEx Lib "kernel32.dll" Alias "CopyFileExA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal lpProgressRoutine As Long, lpData As Any, ByRef pbCancel As Long, ByVal dwCopyFlags As Long) As Long
Public bCancel As Long
Public Function CopyProgressRoutine(ByVal TotalFileSize As Currency, ByVal TotalBytesTransferred As Currency, ByVal StreamSize As Currency, ByVal StreamBytesTransferred As Currency, ByVal dwStreamNumber As Long, ByVal dwCallbackReason As Long, ByVal hSourceFile As Long, ByVal hDestinationFile As Long, ByVal lpData As Long) As Long
'adjust the caption
Form1.Caption = CStr(Int((TotalBytesTransferred * 10000) / (TotalFileSize * 10000) * 100)) + "% complete..."
'allow user input
DoEvents
'continue filecopy
CopyProgressRoutine = PROGRESS_CONTINUE
End Function


Bon courage

++
0
Rejoignez-nous