My.Computer.FileSystem.CopyFile("\\vol1\PRIVATE\BLANC 2015.xlsx", "C:\Temp\BLANC 2015.xlsx", overwrite:= True)
Public Class Form1 'http://plasserre.developpez.com/cours/vb-net/?page=ui-winforms5#LVIII-R-2 Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load Button1.Text = "Start" Button2.Text = "Stop" ProgressBar1.Style = ProgressBarStyle.Blocks 'indique d'avancer par block ProgressBar1.Style = ProgressBarStyle.Continuous 'indique d'avancer progressivement End Sub Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click ProgressBar1.Style = ProgressBarStyle.Marquee End Sub Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click ProgressBar1.Style = ProgressBarStyle.Continuous End Sub End Class
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionpar contre je veux bien un exemple sur ton point 2 car l'aide microsoft n'ai pas illustrée
My.Computer.FileSystem.CopyFile("\\vol1\PRIVATE\BLANC 2015.xlsx", "C:\Temp\BLANC 2015.xlsx", FileIO.UIOption.AllDialogs)
FileIO.UIOption.AllDialogs
Private Sub Form_Activate()
Set F = HScroll1
Set L = Label1
HScroll1.Visible = False
End Sub
Private Sub Command1_Click()
Dim Ret As Long
Me.AutoRedraw = True
HScroll1.Visible = True
Ret = CopyFileEx("d:\ucfoutu.txt", "d:\la_bas.txt", AddressOf allons, ByVal 0&, bCancel, COPY_FILE_RESTARTABLE)
HScroll1.Visible = False
Me.Print "Ayé ===>> " + IIf(Ret = 0, "(E C H E C DE LA C O P I E)", "copie réussie")
End Sub
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, F As Control, L As Control
Public Function allons(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
L.Caption = CStr(Int((TotalBytesTransferred * 10000) / (TotalFileSize * 10000) * 100)) + "% complete..."
F.Value = Int((TotalBytesTransferred * 10000) / (TotalFileSize * 10000) * 100)
DoEvents
allons = PROGRESS_CONTINUE
End Function
15 mai 2015 à 22:54