Advertisement

Results for "Category: Files/ File Controls/ Input/ Output"

ASP_Volume3 #44473
GetShortFileName

A short pathname of the passed string containing a long pathname. 'For example it turns "C:\Windows\MY Long Path Name\My Long Name File.txt" into "c:\windows\mylong~1\mylong~1.txt" (The actual resulting pathname is determined by the short names that windows assigns to all files and directories). 'This is useful when you need to create a fail proof pathname (assuming the file exists and is accesible).

ASP_Volume3 #44486
Raw Disk Access

RDA makes direct, low-level, byte-precise reads and writes to mass-storage devices easy. No need to have to deal with DOS interrupt calls or any such nonsense - RDA takes care of all the behind-the-scenes work for you. RDA also handles the variations in access methods needed by different Windows versions. RDA can read from or write to any specific sector on a logical drive. And if that's not easy enough, there's even a nonvisual frontend component that makes RDA appallingly easy to use - pick drive/first sector/how many sectors to read, call one procedure to perform the actual read, read data from a property. RDA is based on and inspired by a Delphi unit file called VWIN32, written by Geir Wikran, and incorporates portions of VWIN32 directly. As such, RDA is released under the same licensing terms as VWIN32 - free for personal or commercial use as long as the source itself is never sold or misrepresented. PLEASE NOTE: The RDA distribution includes a demo application which requires the TMPHexEditor/TMPHexEditorEx components package by Markus Stephany. This package is available from http://www.mirkes.de/en/delphi/vcls/hexedit.php.

ASP_Volume3 #44489
RmDir

This Procedure Deletes all Files in Directory as well as all Sub Directories and Files

ASP_Volume3 #44492
ShellExec, Wait and Check for changes for a file.

This sample program calls the Windows API to ShellExecute to a file you select. Then it opens the file with it's associated program, waits for the program to end, and identifies if the file has been changed. Rock ON!

ASP_Volume3 #44498
FindFile - Fast, using the API

Uses the FindFile, FindNextFile, and SearchPath API functions to quickly find a file on your hard drive. Runs faster than methods which use Dir$.

ASP_Volume3 #44509
FilesSearch

This sub/function searches your hard drive(s) or directories for file(s) like the Windows 'Find Files or Folders...'. It uses mainly the Dir() command and can be used with any programs and visual basic I have encountered. This helps uses to quickly find a file or program for their applications.

ASP_Volume3 #44535
File Loading Methods Compared

This example compares four file loading methods, (the normal VB Open method, the ReadFile API, and other methods involving MemCopy API), you will also see the difference between returning a String or a Byte Array. I did this example because I keep seeing people using the normal VB Open command to load files, even for Hex editors, as you will see there's a huge difference between using it and using an API. The test in the screen shot was made with a 1GHZ P3 Notebook with 384MB RAM (as a compiled .EXE), please note that times may vary from test to test depending on what your computer's doing, etc. Comments and/or improvements as well as votes are welcome.

ASP_Volume3 #44558
Open Folders As Windows from VB5

This code is for those people who want to open up folders/directories as separate windows, as compared to the alternative fileboxes.

ASP_Volume3 #44574
Command1_click

Allows you to backup a source file and have the destination file name be the current date. Great for database backups!

ASP_Volume3 #44575
Easy routine to check/create directories

This very simple routine avoid checking if a correct path already exist before using it and, if not, create it exactly as you want. Imagine you wont to write a log file in a path defined as: C:\Myapplic\Services\logs\LOG.TXT you must check before if the directory Myapplic exist and then check all other subdirectory (Service,logs) before opening the file For Output. Probably you will use a lot of Error Resume Next, Mkdir(...), Error GoTo 0, dir(....) and so. Instead you can use this routine as described below: Myfile="C:\Myapplic\Services\logs\LOG.TXT" Call CheckDir(Myfile) nf=FreeFile() Open Myfile For Output As #nf . . . Close #nf and including the following .bas module: Public Sub CheckDir(file) Ix = 4 'Initial index KSlash = InStr(1, file, "\", 1) 'Search for first "\" For Cnt = 1 To Len(file) 'Run until discover 'other directories KSlash = InStr((KSlash + 1), file, "\", 1) If KSlash = 0 Then Exit For 'Last slash dir1 = Left(file, (KSlash - 1)) cdir1 = Mid(dir1, Ix) Ix = Ix + Len(cdir1) + 1 hh = Dir(dir1, vbDirectory) 'If Directory doesn't exist, create it If StrComp(hh, cdir1, 1) 0 Then MkDir (dir1) End If Next Cnt End Sub

ASP_Volume3 #44593
Recent Files accessed in a

In a Drop Menu in one of your programs, you can list the last eight files the user opened. This will allow the user to quickly access a recent file again. I literally copied a sample from the VB5.0 package and eliminated the uneeded code.

ASP_Volume3 #44612
Associate File Name and Icon

For those of you who want to add a touch of professionalism to your program, now you can create a file type in the Windows Registry database which will associate all files ending with your program's file extension ( yourfile.xxx) to your program. You also specify an icon for your file type and a description. This example also shows you how to use Command$ to open these files in your program when once the file is clicked or opened, and a quick tip on creating files in the Windows Recent file folder (Start > Documents).

ASP_Volume3 #44613
FileReader Classes

Two class modules that load any size flat file with delimiters (tab, comma, space, etc.) into memory. Once loaded, you can reference any cell that has been loaded... sort of like Excel.

ASP_Volume3 #44624
FastTextStream

Read large text files faster. Reads lines in text files about 30% faster then the TextStream class. Skips much faster.

ASP_Volume3 #44638
Dynamically Pass Form Variables through Forms

This code passes all form variables by creating hidden copies of every form variable that was passed to it. This is great for gathering information over multiples forms (i.e. Order Processing).

ASP_Volume3 #44647
Blocked File IO

This code demonstrates the basics behind blocked IO. This is commonly used when copying files.

ASP_Volume3 #44648
clsScript

This VB Class allows you to quickly and easily read/write files, line by line, word by word.

ASP_Volume3 #44655
*** Destroy a file without getting error! ***

This DOES use the kill function, but when you use this it actually opens the file you want to destroy, cleans it out, then deletes it so you don't get any error because of sensitive data!

ASP_Volume3 #44677
Search for file(s) on a Drive with API

My coding actually does several things. The main thing is that it can search an entire Drive and all of its Directories for a file you specify and at the end of the search display the results of it. Or you can do the same thing but this time look for any file with an extention you specify. I made this search for the file using API but I left a function in there you can edit to search for the files without API but it's a little slower and not recommended. This Screen Shot can pretty much explain it all... E-mail: mikecanejo@hotmail.com AIM: Mike3dd

ASP_Volume3 #44688
Mike's Dummy File Creator

This program will show you how to create a file with a specified size with accuracy. There's not that many uses for this program but it's accurate and comes complete with a progress bar and a size calculator. This is heavily commented, so please post some feedback or even better, vote for it ;]

Languages
Top Categories
Global Discovery