VBnet Sponsor - Compuware Corporation

 

File API Routines
Updated Wednesday April 11, 2001
   
Category
Topic
Attributes
vb6
vb5
vb4-32
Changing File and/or Folder Attributes Recursively
Recursive file searching providing the ability to reset file or folder attributes.  March 25.2001

Searching and Obtaining File Property Information
Recursive file searching that additionally retrieves select file property information.   Nov 29.99



Combine
vb6
vb5
vb4-32
Combining an Image and Text into a Single File
Simple code by Larry Serflaten to combine a text and image into a single file.  May 07.2000

Combining Multiple Elements into a Single File
Extending the above, this combines an image and the contents of three Rich Text controls into a single file. May 07.2000



Common Dialog API
vb6
vb5
vb4-32
File Open Dialog
Fully commented code to call the Win32 FileOpen Common Dialog using API

File Save Dialog
Call the Win32 FileSave Common Dialog using APIs. Requires the code from the FileOpen Dialog code above.



Copying
vb6
vb5
vb4-32
How to Copy Files En-mass to a New Folder Using the CopyFile API
Pass a source and target folder and a filespec, and have this routine do the copying. Will create the destination folder if it doesn't exist.  Sept4.97

Using CopyFile as a File Backup Mechanism
Creating a backup app that compares files before copying. Dec 20.99

Using CopyFileEx and Callback as a File Backup Mechanism
Backup app for NT that uses the CopyProgressRoutine callback to track file copy progress. Dec 20.99



Directories
vb6
vb5
vb4-32
An API 'FolderExists' Routine
Using FindFirstFile to determine if a specified folder exists. Oct 20.99

How to Create Nested Directories
Two methods to created a nested hierarchy of folders. Sept 19.98



Disk Info
vb6
vb5
vb4-32
Determining Free Disk Space In Win95
The code to determine clusters, sectors, used and free space on a release version of Win95 (pre-OSR/2).

Determining Free Disk Space on a Fat32 Drive
The code to determine total, used and free space on a Fat32 drive made with Windows 95 OSR2 or Windows 98.

Determining if a Floppy Drive is Ready
Four wrapper routines that each determine if a removable drive is ready. Sept 12.99

How to Enumerate the Available System Drives
API method to determine a system's installed drives and their type.

How to Determine if a Specific Drive Exists
API method to determine if the system has a specific drive letter.

How to Obtain a System's CD-ROM Drive Information
Code to determine if the target system has a CD-ROM installed, obtain its drive letter, and the volume name of an inserted CD.

How to Retrieve Drive Information Using GetDiskFreeSpace and GetDiskFreeSpaceEx
Retrieve drive and volume information for any size partition or drive on any 32-bit platform. July 29.99

Using GetDiskFreeSpaceEx for Disk Information on 32-bit Windows
Four wrappers for retrieving disk free and used space info on any 32-bit Windows system.  Dec 23.99



Drag & Drop
vb6
vb5
vb4-32
Implementing File Drag & Drop in a Visual Basic Project
APIs to turn a listbox into a drag-drop receptacle.


Drives
vb6
vb5
vb4-32
An API 'DriveExists' Routine
Using GetLogicalDriveStrings to determine if a specified drive exists. Oct 20.99

Determining if a Floppy Drive is Ready
Four wrapper routines that each determine if a removable drive is ready. Sept 12.99


Extract
vb6
vb5
vb4-32
Obtaining the Filename from a Full Path using FindFirstFile
Small function returning the filename alone from a full path and filename. Feb 11.2001

 



File Associations
vb6
vb5
vb4-32
Creating a Visual Basic File Association
Now your application will launch whenever its associated file is clicked in Explorer. June 29.98

Determining the Name of the Executable Associated with a Specific File
Use FindExecutable to retrieve the file associated with a particular file extension. Sept 12.99

Obtaining the Path and Filename of the Default Browser
Using FindExecutable and a temporary file to determine the application associated with html files. Oct 13.99

Starting Specified URLs in Separate Instances of the Default Browser
Using FindExecutable and CreateProcess to force URLs to open in new sessions of a browser.  Oct 18.99



File/Date Routines
vb6
vb5
vb4-32
Obtaining and Changing a File's Created, Accessed and Modified Dates
Once the debug code provided is removed, you'll be left with a half-dozen line routine to retrieve and set/reset a file's Created, Last Accessed or Last Modified dates.


File Searching
vb6
vb5
vb4-32
Performance Comparison - FSO vs API
Herein lies the truth - the FileSystemObject and API compared for file searching Apr 12.2000

Performing Recursive Searches Using FindFirst and SearchTreeForFile
Four very fast, functional routines for file and folder searching. Oct 3.99

Retrieving Internet Favourites Information
Extracting the shortcut name and URL from an IE Favourite. Mar 09.2000

Saving a Recursive Search of All Drives to Disk
Build on the Recurse methods to grab all the filenames from a system and write them to disk. Oct 8.99

Saving a Recursive Search of All Drives to Disk, Advanced
Advanced disk searching using the FindFirstFile recursion methods to grab all the filenames from a system and write them to disk. Oct 8.99

Searching a Drive Using SearchTreeForFile
Use this simple API to locate the full path to a specific file. June 12.99

Searching and Obtaining File Property Information
Recursive file searching that additionally retrieves select file property information.   Nov 29.99



FindFirst - FindNext Change
vb6
vb5
vb4-32
Creating a Watched Folder with FindFirst/NextChange Notifications
Monitor when the contents of a folder or subfolder have changed.

 



FindFirst - FindNext File
vb6
vb5
vb4-32
An API 'FileExists' Routine
For the API purists, the popular FileExists wrapper via API. June 17.98

An API 'FolderExists' Routine
Using FindFirstFile to determine if a specified folder exists. Oct 20.99

Changing File and/or Folder Attributes Recursively
Recursive file searching providing the ability to reset file or folder attributes.  March 25.2001

Enumerating Folders using FindFirstFile and FindNextFile API
API routine recursively load a treeview control with the folders on a selected drive.

Enumerating Folders using FindFirstFile and FindNextFile API, Advanced
Building on the code from the above page, this method provides for the optional loading of folders for either a single-level or an entire drive, and adds visual identification to the drives and folders with ImageList icons.  

Obtaining a Directory File Count Using FindFirstFile and FindNextFile
Use this tight routine to count the files in a given folder in blistering speed. Uses a passed filespec as the counting parameter. Includes routines to perform attribute-specific counts as well. Sept 4.97

Obtaining the Filename from a Full Path using FindFirstFile
Small function returning the filename alone from a full path and filename. Feb 11.2001

Performance Comparison - FSO vs API
Herein lies the truth - the FileSystemObject and API compared for file searching. Apr 12.2000

Performing Recursive Searches Using FindFirst and SearchTreeForFile
Four very fast, functional routines for file and folder searching. Oct 3.99

Retrieving Internet Favourites Information
Extracting the shortcut name and URL from an IE Favourite. Mar 09.2000

Saving a Recursive Search of All Drives to Disk
Build on the Recurse methods to grab all the filenames from a system and write them to disk. Oct 8.99

Saving a Recursive Search of All/Select Drives to Disk, Advanced
Advanced disk searching using the FindFirstFile recursion methods to grab all the filenames from a system and write them to disk. Oct 8.99

Searching and Obtaining File Property Information
Recursive file searching that additionally retrieves select file property information.   Nov 29.99

Using CopyFile as a File Backup Mechanism
Creating a backup app that compares files before copying. Dec 20.99

Using CopyFileEx and Callback as a File Backup Mechanism
Backup app for NT that uses the CopyProgressRoutine callback to track file copy progress. Dec 20.99



FindFirst - FindNext URL
vb6
vb5
vb4-32
Deleting the Internet Cache
Using DeleteUrlCacheEntry to empty the internet cache programmatically. Dec 06.99

Retrieving the Internet Cache with FindFirst/NextUrlCacheEntry
Find URL and cookie info from your Internet cache. Nov 16.99



FTP
vb6
vb5
vb4-32
FTP: Connecting To and Retrieving FTP File Listings
Using the FTP APIs to connect to a site and retrieve its file listing. Dec 17.99

FTP: Downloading Files via FTP
Adding to the FTP demo adding file download ability. Dec 17.99

FTP: Downloading Files Using the FTP Download Dialog
Use the Internet Explorer File Download dialog in your application.  Jan 8.2000



INI Files
vb6
vb5
vb4-32
vb4-16
vb3
Create the "Kidz Quiz" project
Code to create a child's quiz application, easily extended to cover adults. Aug 24.99

Retrieving Internet Favourites Information
Extracting the shortcut name and URL from an IE Favourite. Mar 09.2000

Using INI Files to Save Application Data - The Basics
Primer on saving and reading data from private ini files. Aug 13.99

Using INI Files to Save Application Data - Saving Entire Sections
INI section manipulation - saving and restoring an entire list from private ini files. Aug 13.99



Paths
vb6
vb5
vb4-32
Shell Path Routines: File/Folder/Drive Exists
Tests the validity of the file and path on the local file system or on a remote drive that has been mounted to a drive letter. Apr 08.2001

Shell Path Routines: IsDirectoryEmpty
Determines whether or not a specified path is an empty directory. Apr 08.2001

Shell Path Routines: IsPathAFile
Determines whether or not a specified path contains path delimiting characters. Apr 08.2001

Shell Path Routines: IsPathAFolder
Verifies that a path is a valid directory. Apr 08.2001

Shell Path Routines: IsPathARoot
Parses a path to determine if it is a directory root. Apr 08.2001

Shell Path Routines: IsPathLFN
Determines whether or not a file name is in long format. Apr 08.2001

Shell Path Routines: IsPathLocalPath
Determines whether a path string represents a local resource. Apr 08.2001

Shell Path Routines: IsPathNetPath
Determines whether a path string represents a network resource. Apr 08.2001

Shell Path Routines: IsPathRelative
Searches a path and determines if it is relative. Apr 08.2001

Shell Path Routines: IsUNCPathAShare
Determines if a string is a valid universal naming convention (UNC) share path, \\server\share. Apr 08.2001

Shell Path Routines: IsUNCPathAServer
Determines if a string is a valid UNC (universal naming convention) for a server path only. Apr 08.2001

Shell Path Routines: IsUNCPathValid
Determines if the string is a valid UNC (universal naming convention) for a server and share path. Apr 08.2001

Shell Path Routines: IsPathAURL
Determines if a string string conforms to a valid URL format. Apr 08.2001



Temporary Files
vb6
vb5
vb4-32
Creating Temporary Files Using GetTempFileName
Use Windows' built-in functions to create working files as needed.  Aug 02.98


VBnet Sponsor - Compuware Corporation

Copyright ©1996-2001 ebirch ltd/VBnet and Randy Birch. All Rights Reserved.  Terms of Use