Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

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

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

 

Set File Creation, Modified, Last Accessed Dates
Total Hit (2902) 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.
Rating
Add a file to the list of recent documents
Total Hit (2916) 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
Rating
Checking if a Floppy Drive is ready using FileSystemObject library
Total Hit (3420) 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
Rating
Copy a directory tree
Total Hit (2948) 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
Rating
Counting characters in a file
Total Hit (3730) 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
Rating
Delete a folder and all its subfolders
Total Hit (3340) 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
Rating
Get the canonical name of a file
Total Hit (3361) 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
Rating
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 (2871) 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»
Rating
Load a text file in one operation
Total Hit (2826) 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
Rating
Retrieve information on all available drives
Total Hit (3038) 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
Rating
Search a file in a directory tree using the Imagehlp DLL
Total Hit (3663) 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
Rating
Using the CreateDirectory and CreateDirectoryEx API functions
Total Hit (6757) 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
Rating
AddBackslash - Append a backslash to a path if needed
Total Hit (3085) «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
Rating
ChangeFileExtension - Modify the extension in a file name
Total Hit (2701) «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
Rating
CompactPathToWindow - Shorten a path so that it fits a window's width
Total Hit (3401) «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
Rating
CompareDirectories - Find different files in two directories
Total Hit (2961) «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
Rating
CompareFiles - Check whether two files contain the same data
Total Hit (3062) «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
Rating
ConcatenateFiles - Merge multiple text files in one
Total Hit (3024) «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
Rating
DirExists - Check that a directory exists
Total Hit (3200) «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
Rating
EvalFileName - Ensure that the basename of a file or directory is valid
Total Hit (2594) «Code LangId=1»' EvalFileName ensures that the basename of a file or directory ' conforms to the Microsoft file naming guidelines (see MSDN webpage) ' http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/ ' naming_a_file.asp ' ' Return value: ' True = Valid basename ....Read More
Rating
FileExists - Check that a file exists
Total Hit (3729) «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
Rating
FilesToArray - Read all the files or subdirectories in a directory using API functions
Total Hit (4145) «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
Rating
FolderHasSubfolders - Determine whether a directory has one or more subdirectories
Total Hit (2935) «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
Rating
GetAllExecutableFiles - The list of all executable files in a directory tree
Total Hit (2693) «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
Rating
GetAllFiles - Search files in a directory or directory tree
Total Hit (4643) «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
Rating
GetAllPictureFiles - The list of all image files in a directory tree
Total Hit (3183) «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
Rating
GetAttrDescr - The attributes of a file in a readable format
Total Hit (2606) «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
Rating
GetDirectories - Returns all the subdirectories of a directory
Total Hit (3209) «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
Rating
GetDirectorySize - Evaluate disk space used by files and subdirectories
Total Hit (2905) «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
Rating
GetDriveTypeEx - Detect drive type, including CD or DVD driver
Total Hit (7356) «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
Rating


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

Recommanded Links

 

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

© 2008 BinaryWorld LLC. All rights reserved.