Atlanta Custom Software Development 

   Search        Code/Page

User Login



Forgot the Password?
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
VB VB (1647) (736)
C# C# (15) (779)
ASP ASP (41)
VC++ VC++ (25)
JScript JScript (5)
» SQL Server (708)
» ORACLE (5)
» MySQL (0)
» DB2 (0)
» C/C++/ASM (11)
» Microcontroller (1)
» Circuit Design (0)
» Networking (5)
» Unix/Linux (1)
» WinNT/2k/2003 (8)
» Flash (0)
» Maya (0)
» 3D max (0)
» Photoshop (0)
» (2)
» PC Interfacing (1)
» Networking (4)
» SQL Server (4)
» VB (23)
» (4)
» VC (3)
» HTML/CSS/JavaScript (10)
» Regular Expr Tester
» Free Tools

(Page 1 of 3) 89 Result(s) found 

Set File Creation, Modified, Last Accessed Dates
Total Hit (778) Often times you may need to touch a file by setting its Created, Modified or Last Accessed date and time. This sample shows how to do it.
Add a file to the list of recent documents
Total Hit (832) To add a file to the "Recents" folder, you just need a single API function: SHAddToRecentDocs. This function takes two parameters. The first is SHARD_PATH if you want to refer to the file with its path string, while is SHARD_PIDL if you use its identifier. The second is the path string of the file, ....Read More
Checking if a Floppy Drive is ready using FileSystemObject library
Total Hit (883) The Microsoft Scripting Runtime Library offers a FileSystemObject and a Drive object that allow you to check if a Floppy drive is ready. Before writing the code you have to add this library to your project using the References dialog window. If the library isn't contained in the list, you can downlo ....Read More
Copy a directory tree
Total Hit (915) Creating a VB routine that copies a whole directory tree can be a time-consuming job, but fortunately you don't have to do it. In fact, you can quickly create an entire folder, including all its subfolders, using the CopyFolder method of the FileSystemObject object, that is exposed by the Microsoft ....Read More
Counting characters in a file
Total Hit (996) Ever needed to count how many characters of a given type are in a file? For instance, how many alphabetical characters, or digits, or spaces? You might read each line of the file using Line Input, but you will probably to load the whole file in memory using one single operation: «Code LangId=1» ....Read More
Delete a folder and all its subfolders
Total Hit (1347) The RmDir command can delete a directory only if it doesn't contain files or sub-directories. If the directory you want to delete does contain other files or, worse, subdirectories it seems that you are forced to use a recursive routine that does the job. A simpler solution is offered by the Dele ....Read More
Get the canonical name of a file
Total Hit (1035) In many cases you may need the canonical (or absolute) name of a file, for example when you need to compare two relative file names (relative to the current directory or drive, that is) and decide whether they point to the same or different files. You can obtain the canonical path of a file usin ....Read More
The simplest way to help user copy a floppy disk is display the Copy Disk system dialog. You can do this with a one-line statement: Let the user copy floppy disks
Total Hit (705) The simplest way to help user copy a floppy disk is display the Copy Disk system dialog. You can do this with a one-line statement: «Code LangId=1» Shell "rundll32.exe diskcopy.dll,DiskCopyRunDll 0,0" «/Code»
Load a text file in one operation
Total Hit (848) The fastest way to read a text file is using the Input$ function, as shown in this reusable procedure: «Code LangId=1» Function FileText (filename$) As String Dim handle As Integer handle = FreeFile Open filename$ For Input As #handle FileText = Input$(LOF(handle), handle) ....Read More
Retrieve information on all available drives
Total Hit (796) You can retrieve information about all the available drives using calls to Windows API, if you like the hard way of doing things. A much simpler solution is offered by the Microsoft Scripting Runtime library, that exposes a Drive object that lets you get all those info by querying a property: ....Read More
Search a file in a directory tree using the Imagehlp DLL
Total Hit (1090) You can search a file in all the subdirectories of a given drive in VB using a recursive routine based on the Dir$ function, the FileSystemObject component, or the FindFirstFile/FindNextFile API functions. There is a fourth way you might want to try out, based on the SearchTreeForFile function embed ....Read More
Using the CreateDirectory and CreateDirectoryEx API functions
Total Hit (1975) The VB's MkDir function creates a directory in a specified path. If the directory already exists, MkDir raises error 75 (Path/file access error); yet, it raises the same error code if you attempt to create the directory on a read-only drive. Even worse, in Windows NT/2K/XP workstations, if you try t ....Read More
AddBackslash - Append a backslash to a path if needed
Total Hit (766) «Code LangId=1»' Append a backslash (or any character) at the end of a path ' if it isn't there already Function AddBackslash(Path As String, Optional Char As String = "\") As String If Right$(Path, 1) <> Char Then AddBackslash = Path & Char Else AddBackslash = Path ....Read More
ChangeFileExtension - Modify the extension in a file name
Total Hit (646) «Code LangId=1» ' Change the extension of a file name ' if the last argument is True, it adds the extension even if the file doesn't ' have one Function ChangeFileExtension(FileName As String, Extension As String, _ Optional AddIfMissing As Boolean) As String Dim i As Long For ....Read More
CompactPathToWindow - Shorten a path so that it fits a window's width
Total Hit (983) «Code LangId=1» Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type Private Declare Function IsWindow Lib "user32" (ByVal hWnd As Long) As Long Private Declare Function GetClientRect Lib "user32" (ByVal hWnd As Long, _ lpRect As RECT) As Lon ....Read More
CompareDirectories - Find different files in two directories
Total Hit (714) «Code LangId=1» Enum CompareDirectoryEnum cdeSourceDirOnly = -2 ' file is present only in the source directory cdeDestDirOnly = -1 ' file is present only in the dest directory cdeEqual = 0 ' file is present in both directories, ' with s ....Read More
CompareFiles - Check whether two files contain the same data
Total Hit (782) «Code LangId=1»' compare two files ' return True if they're equal Function CompareFiles(ByVal file1 As String, ByVal file2 As String) As Boolean Dim fnum1 As Integer, isOpen1 As Boolean Dim fnum2 As Integer, isopen2 As Boolean Dim buffer1 As String, buffer2 As String Dim byt ....Read More
ConcatenateFiles - Merge multiple text files in one
Total Hit (831) «Code LangId=1» ' Concatenate a variable number of text files into a single result file ' ' Params: ' - ResultFile: the complete path of the result file you want to create ' - Separator: a string that is written when a file is added to the result ' file. ' Note: this string can conta ....Read More
DirExists - Check that a directory exists
Total Hit (892) «Code LangId=1» ' Return True if a directory exists ' (the directory name can also include a trailing backslash) Function DirExists(DirName As String) As Boolean On Error GoTo ErrorHandler ' test the directory attribute DirExists = GetAttr(DirName) And vbDirectory ErrorHandler: ....Read More
EvalFileName - Ensure that the basename of a file or directory is valid
Total Hit (617) «Code LangId=1»' EvalFileName ensures that the basename of a file or directory ' conforms to the Microsoft file naming guidelines (see MSDN webpage) ' ' naming_a_file.asp ' ' Return value: ' True = Valid basename ....Read More
FileExists - Check that a file exists
Total Hit (1582) «Code LangId=1»' Return True if a file exists Function FileExists(FileName As String) As Boolean On Error GoTo ErrorHandler ' get the attributes and ensure that it isn't a directory FileExists = (GetAttr(FileName) And vbDirectory) = 0 ErrorHandler: ' if an error occurs, this ....Read More
FilesToArray - Read all the files or subdirectories in a directory using API functions
Total Hit (1342) «Code LangId=1» Private Declare Function FindFirstFile Lib "kernel32" Alias "FindFirstFileA" _ (ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As Long Private Declare Function FindNextFile Lib "kernel32" Alias "FindNextFileA" _ (ByVal hFindFile As Long, lpFindFileData As ....Read More
FolderHasSubfolders - Determine whether a directory has one or more subdirectories
Total Hit (777) «Code LangId=1»Private Const MAX_PATH = 260 Private Type SHFILEINFO hIcon As Long iIcon As Long dwAttributes As Long szDisplayName As String * MAX_PATH szTypeName As String * 80 End Type Private Declare Function SHGetFileInfo Lib "Shell32" Alias "SHGetFileInfoA" _ ....Read More
GetAllExecutableFiles - The list of all executable files in a directory tree
Total Hit (627) «Code LangId=1»' Returns a collection with the names of all the executable ' files in a directory or a directory tree ' this includes all "exe", "bat", "com", "pif" files ' ' NOTE: Uses the GetFiles, GetDirectories, and GetAllFiles routines Function GetAllExecutableFiles(ByVal path As String ....Read More
GetAllFiles - Search files in a directory or directory tree
Total Hit (1879) «code LangId=1»Private Sub Command1_Click() Dim col As Collection '//Get all files from C:\ (No sub folder) which are older than 5 days and newer than 30 days Set col = GetAllFiles("c:\", "*.*", False, 30, 5) For Each f In col Debug.Print FileDateTime(f) & "=>" & f ....Read More
GetAllPictureFiles - The list of all image files in a directory tree
Total Hit (879) «Code LangId=1»' Returns a collection with the names of all the image ' files in a directory or a directory tree ' this includes all the image types that can be loaded into a PictureBox control ' ' NOTE: Uses the GetFiles, GetDirectories, and GetAllFiles routines Function GetAllPictureFiles( ....Read More
GetAttrDescr - The attributes of a file in a readable format
Total Hit (600) «Code LangId=1» ' The attributes of a file in a readable format. ' It works also with open files, raises an error if the file doesn't exist. Function GetAttrDescr(filename As String) As String Dim result As String, attr As Long ' get file attributes as a bit-coded field attr = ....Read More
GetDirectories - Returns all the subdirectories of a directory
Total Hit (738) «Code LangId=1»' Returns a collection holding all the subdirectories in a path ' that match search attributes (optionally it returns the entire path). Function GetDirectories(path As String, Optional Attributes As VbFileAttribute, _ Optional IncludePath As Boolean) As Collection Dim d ....Read More
GetDirectorySize - Evaluate disk space used by files and subdirectories
Total Hit (810) «Code LangId=1»' Retrieve the number of bytes by all the files in a directory ' (it doesn't account for slack space, that is unused space in disk sectors) ' ' If INCLUDESUBDIRS is true, it recursively parses all subdirectories. ' ' supports only up to 2G directories. Function GetDirectorySi ....Read More
GetDriveTypeEx - Detect drive type, including CD or DVD driver
Total Hit (4034) «code LangId=1»Private Type DEVICE_MEDIA_INFO Cylinders As Double MediaType As STORAGE_MEDIA_TYPE TracksPerCylinder As Long SectorsPerTrack As Long BytesPerSector As Long NumberMediaSides As Long MediaCharacteristics As Long End Type Private Type GET_MEDIA_TYPES ....Read More

(Page 1 of 3) 89 Result(s) found  1 2 3

Recommanded Links


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  Blogs

© 2008 BinaryWorld LLC. All rights reserved.