VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Copy FIle

by Peter Elisa Souhoka (21 Submissions)
Category: Files/File Controls/Input/Output
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 4th November 2008
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Copy FIle

Rate Copy FIle



Private Const FO_Copy = &H2
Private Const For_Allowundo = &H40

Private Type SHFILEopstruct
hwnd As Long
wfunc As Long
pform As String
pto As String
fflags As Integer
faborted As Boolean
hnamemaps As Long
sprogress As String

End Type

Public Sub copy(ByVal asal As String, ByVal tujuan As String)
Dim x As SHFILEopstruct
With x
.hwnd = 0
.wfunc = FO_Copy
.pform = asal & vbNullChar & vbNllChar
.pto = tujuan & vbNulChar & vbNullChar
.fflags = fof_allowundo
End With
SHFileOperation x
End Sub

Private Sub Command1_Click()
copy Text1.Text, Text2.Text
MsgBox "File Sudah dicopy"
End Sub

Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub

Private Sub Dir2_Change()
Text2.Text = Dir2.Path
End Sub

Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub

Private Sub Drive2_Change()
Dir2.Path = Drive2.Drive
End Sub



Private Sub File1_Click()
Text1.Text = File1.Path & "\" & File1.FileName
End Sub


Download this snippet    Add to My Saved Code

Copy FIle Comments

No comments have been posted about Copy FIle. Why not be the first to post a comment about Copy FIle.

Post your comment

Subject:
Message:
0/1000 characters