Article View: be.comp.programming
Article #13597vraagje over bestanden copi�ren in VB5
From: koalf
Date: Sat, 16 Jun 2001 11:34
Date: Sat, 16 Jun 2001 11:34
48 lines
2252 bytes
2252 bytes
Hallo
Hieronder staat VB-code die zou moeten bestanden copi�ren van de ene map
naar de andere, maar ik krijg steeds de melding 'Copi�ren van bestanden
mislukt!!!'
Waar zit mijn fout?
MVG
Private Declare Function GetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) _
As Long
Private Declare Function copyfile Lib "kernel32" Alias _
"CopyFileA" (ByVal lpszexistingfile As String, _
ByVal lpsznewfile As String, ByVal fFailifexists As Long) As Long
Private Sub Form_Load()
Dim s As String
Dim cnt As Long
Dim dl As Long
Dim CurUser As String
Dim ctl As Long
Dim sourcepath As String
Dim destpath As String
cnt = 199
s = String$(200, 0)
dl = GetUserName(s, cnt)
If dl <> 0 Then CurUser = Left$(s, cnt) Else CurUser = ""
txtname.Text = CurUser
sourcepath = "c:\" & txtname.Text & "\*.*"
destpath = "g:\" & txtname.Text & "\*.*"
ctl = w95filecopyex(sourcepath, destpath, True)
If ctl = 0 Then MsgBox "Kopi�ren van bestanden mislukt!!!"
End Sub
Public Function w95filecopyex(sourcefile$, destfile$, NoOverwrite As
Boolean) As Long
w95filecopyex = copyfile(sourcepath, destpath, NoOverwrite)
End Function
Technical Details
Message-ID:
<dvHW6.37599$mR5.4977022@afrodite.telenet-ops.be>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!193.190.198.17!newsfeeds.belnet.be!news.belnet.be!afrodite.telenet-ops.be!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: fcea4,7a4f5b6daff8480e,start X-Google-Attributes: gidfcea4,public X-Google-ArrivalTime: 2001-06-16 04:34:42 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!193.190.198.17!newsfeeds.belnet.be!news.belnet.be!afrodite.telenet-ops.be!not-for-mail From: "koalf" <koalf@yahoo.com> Newsgroups: be.comp.programming Subject: vraagje over bestanden copi�ren in VB5 Lines: 52 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2462.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000 Message-ID: <dvHW6.37599$mR5.4977022@afrodite.telenet-ops.be> Date: Sat, 16 Jun 2001 11:34:33 GMT NNTP-Posting-Host: 213.224.116.80 X-Complaints-To: abuse@pandora.be X-Trace: afrodite.telenet-ops.be 992691273 213.224.116.80 (Sat, 16 Jun 2001 13:34:33 MET DST) NNTP-Posting-Date: Sat, 16 Jun 2001 13:34:33 MET DST Organization: Telenet Internet