Read and Write File Contents Using the API

Category:
Files and Directories
Type:
Modules
Difficulty:
Advanced
Author:
Intelligent Solutions Inc.

Version Compatibility: Visual Basic 6

More information:
This module contains four functions: One that reads string data from a file using the ReadFile API function, one that reads binary data into a byte array, one that writes string data to a file using the WriteFile API function, and one that writes a byte array to a file.

VB 6 or higher is required because one of the functions returns an array. You can change this to a variant if you want to use this in VB5.


Instructions: Click the link below to download the code. Select 'Save' from the IE popup dialog. Once downloaded, open the .zip file from your local drive using WinZip or a comparable program to view the contents.

Download fileapi.zip