• ¡Welcome to Square Theme!
  • This news are in header template.
  • Please ignore this message.
مهمان عزیز خوش‌آمدید. ورود عضــویت


امتیاز موضوع:
  • 12 رای - 2.42 میانگین
  • 1
  • 2
  • 3
  • 4
  • 5
Title: Copy a File Quickly
حالت خطی
#1
با سورس کد زیر میتونید به سرعت فایلی رو کپی کنید در مقصد مورد نظرتون

Visual Basic is often seen as a tool to create front end GUI intensive applications. However, it can also easily be used to do lower level tasks such as quickly copying one file to another byte by byte. This code snippet demonstrates how you can easily take one file and copy it to a second one as quickly as possible. The way it does this is by pulling the whole file into memory and then writing it back out to the second file name.

This sample demonstrates some of VB's File IO operations such as Open, Get, and Put. It also demonstrates how you can declare a variable array and then change its size using the ReDim construct.

To implement this source code create a new VB6 program, add a button to the form, double click the button to get into its click event handler method, and add the following code within that method.
کد:
Dim mByte() As Byte
    
    Open "C:\Command.com" For Binary As #1
    Open "C:\Backup.com" For Binary As #2
    
    ReDim mByte(0 To LOF(1))
    
    Get #1, , mByte()
    Put #2, , mByte()
    
    Close #1
    Close #2
    MsgBox "Done", vbInformation
گروه دور همی پارسی کدرز
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg
 
پاسخ
  


پیام‌های این موضوع
Copy a File Quickly - توسط Amin_Mansouri - 03-24-2012، 12:44 PM
RE: Copy a File Quickly - توسط Kei armin - 03-24-2012، 04:30 PM

موضوعات مشابه ...
موضوع نویسنده پاسخ بازدید آخرین ارسال
  Open File Binary And Search String In Files Amin_Mansouri 1 4,264 01-24-2017، 04:15 PM
آخرین ارسال: aminjannoukaretam
  copy a.adhami 1 2,899 10-06-2014، 02:50 PM
آخرین ارسال: Amin_Mansouri
  استفاده از شی File System Object در ویژوال بیسیک Ghoghnus 0 2,757 04-24-2012، 06:54 PM
آخرین ارسال: Ghoghnus
  Retrieve File Association and open a file in its native application Amin_Mansouri 0 2,589 04-15-2012، 07:14 PM
آخرین ارسال: Amin_Mansouri
  حل مشکل باز نشدن فایل های space دار و رفع پیغام file not found Amin_Mansouri 0 4,081 08-29-2011، 04:17 PM
آخرین ارسال: Amin_Mansouri
  Delete File Amin_Mansouri 0 3,025 05-10-2011، 05:06 PM
آخرین ارسال: Amin_Mansouri
  Source code Insert & Delete data from a file Amin_Mansouri 0 3,443 04-29-2011، 03:56 PM
آخرین ارسال: Amin_Mansouri
  Source Code Burn Iso File Amin_Mansouri 0 3,179 04-19-2011، 11:38 AM
آخرین ارسال: Amin_Mansouri

پرش به انجمن:


Browsing: 1 مهمان