Wrox Programmer Forums
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 20th, 2006, 10:24 AM
Authorized User
 
Join Date: Dec 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default How copy Any file on LAN

hi every one
please tell me how any file copy on LAN in Vb 6.0
and which control and component will use.

Plz help me

 
Old March 21st, 2006, 09:43 AM
Registered User
 
Join Date: Oct 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hello rahul
You can use Microsoft Internet Transfer Control 6.0.
following code is ur remedy


Dim Size As Long, Remaining As Long, FFile As Integer, Chunk() As Byte

    Inet1.Execute "http://www.codeguru.com/forum/images/cg-logo.gif", "GET"

    Do While Inet1.StillExecuting
        DoEvents
    Loop

    Size = CLng(Inet1.GetHeader("Content-Length"))
    Remaining = Size

    FFile = FreeFile
    Open "c:\logo.gif" For Binary Access Write As #FFile
    Do Until Remaining = 0

        If Remaining > 1024 Then
            Chunk = Inet1.GetChunk(1024, icByteArray)
            Remaining = Remaining - 1024
        Else
            Chunk = Inet1.GetChunk(Remaining, icByteArray)
            Remaining = 0
        End If

        Put #FFile, , Chunk

    Loop
    Close #FFile

    MsgBox "File downloaded"

End Sub


bye

[email protected]








Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy one sheet to another file shamigc Excel VBA 2 April 13th, 2005 06:45 AM
Macro to copy data from one file to a 2nd file chadpodsednik Excel VBA 1 October 29th, 2004 10:40 AM
How to copy file? eapsokha Classic ASP Databases 2 November 14th, 2003 11:44 AM
JProgressBar while file copy rpalanivelu J2EE 0 November 3rd, 2003 08:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.