Results for "Category: Files/ File Controls/ Input/ Output"
Well, my IGCSE mocks just finished yesterday so I was thinking what to do...so just to brush my skills (:D), I made this... We all know what the heck are INI files (if you don't, read their brief description at the bottom)...but did you know that these INI files have a size limit? YES! You see, when you call the Windows API, you will not be able to read files that are bigger than 10kb (on win 9.x i think...correct me if I am wrong) and 64kb on win me/nt/2k. So the next time you try to read a value that is held in position after the 64k/10k mark on a file, all u'll get is a blank (you can do the GetLastError API to see what error was, never tried it though). But HO HO! (look who comes to the rescue) During the past 1 and a half hours (or something), I just wrote a class that will read INI's all by opening them for input and output, and ofcourse, parsing them on their way. So now, throw away ur existing API INI classes and replace these. Features: 1. No more INI File size limit 2. Useful for writing file formats. Yes! For example, I previously wrote an INI script format(crazy idea, huh?) in which some values of keys were actually the names of other keys and in this way, a flow of data can be formed that doesn't have to follow hard-coded format. 3. As fast (well, almost....now, reading a teeny weeny value from a 500kb file that contained 50,000 items took 5 seconds or something on my computer...btw, the file was generated to test the class. Also, there is hardly any noticeable difference between the API and this class even if the file is smaller than 64k). 4. Other features that were included were: Read/Write value (basic INI I/O), Delete a key, Delete the whole darn Section, get all sections (only sectionsuseful for enumerating...file formats!), get all keys with their values all together (useful for enumerating...again file formats!), write values all at once from an array (instead of doing them one by one, which may get slow). 5. It's a drop-in class...just drop and use! very easy parameters to follow :) WHAT INIs ARE: INIs came along with the advent of Windows OSes. They were initially (and, well, still are) are used for storing settings of a program. You can say INI is a standard file format for saving settings (I say standard when I mean Windows standard). Windows supplies APIs that make it easy for us, the developers, to read and write values using just plain strings, which the Windows APIs organises into a format in a file. The format is: 1. There is a section that represents a number of keys (both of which you set) 2. There are keys that represent values (you set the values too) 3. Then there are other sections, 4. with other keys, 5. with other values. 6. blah blah and oh ya, I didn't do an example cuz I think almost everyone might have come across INI files (and anyway, it will take only 3 lines max to write a value to a file using this class) (vote if you like :D...I dont mind, nor do I bite...so criticism [not in a harsh way, mind you] may be appreciated.) Tata!
Here you can make a new folder with just ONE line of code. You decide where you wanna place the folder(like 'c:\New Folder\Sub\'). You don't need any extra OCX's or other kind of controls so just take the code and enjoy it. The code is very useful to me and im sure it will be to you too. /Author
Directory Tree View. This is an activeX control which which looks like windows explore Folder view. This is to display on you drives in a tree control and and desktop, plus my documents and much more.
This is a compact code that changes the date of an at the moment hard coded file to the time at the moment.
Does anything you want to files in a directory and its subdirectories. For example, if you would like to add MP3's in a directory to a playlist in your MP3 player program, this would be handy for adding all of the files including those residing in subdirectories of that directory.
This gives you the Windows 95+ directory listing with My Documents, Desktop, etc. Two projects are included in this zip, one that has the project as an executable, one that has it as an ActiveX usercontrol. Simple code, lots of comments. Please leave feedback and vote!
Networked drives. They're an administrative nightmare. In fact, the average user changes his networked drive letters more often than his underwear. But you can solve this problem of binding an application to a particular drive by using a Universal Naming Convention (UNC) path. This still references a network area, but doesn’t tie it to any one drive letter. And you can retrieve and check the UNC of a particular path in code using this neat little function. To use it, simply call GetUNCPath, passing it your drive letter along with a pre-declared empty string. If a problem occurs, the relevant number is passed back with the function. These can be matched with the possible return code constants. However if everything goes swimmingly, the function returns a zero (a constant value of NO_ERROR) and places the UNC path into the ByRef-passed variable. This code works by making a call to the WNetGetConnection function in MPR.DLL. It's essentially a neat wrapper for a regular API call.
This VERY Simple 5 Line Code Writes To a INI File! Enjoy!
This code will create an internet shortcut on someone's computer. All you have to do it call it with a path and hyperlink!
With a small bit of coding, you can modify this app to suit your office server environment as a fully function FAX SERVER. You MUST be running WINDOWS 2000 / WINDOWS NT, as these are the only two OS's that have the FAX SERVER Object.
This is a fast way to write a resource to a file. UPDATE: You can find an example to this code here.
Common Dialog Template. This small project explores the use of the Show methods of the Common Dialog. Want to know if the user entered an unexpected extention? Want the dialog to return a file name that does or does not exist? I have included most of the constants and properties associated with each method; not so much to show how they are use, but as a reminder of what is there. Try different things and see what happens. The open and save methods seem to have the most options and therefore the most complexity. So have fun and see if this works with that....
Need to create a temporary file for whatever? Include this bas module in your project and with one line of code the file will be created and the name returned to your program. Sample project included.
BAS Module that handle several FileSystemObject methods using Windows API calls. Several new functions were added. This module will make file/folders operations a breeze.
Calculates a unique CRC32 hash based on strings from important sections of your exe (as opposed to the entire exe, including non-critical things such as images, sound etc). This means you can protect exe's of virtually ANY size using CRC32. If you choose your sections carefully enough, the protection can be just about as good as if you had protected every byte in the file. Please vote for this if you think it's worthy of one :-)
Deletes a specified directory tree.
When i started to program, i REALLY wanted to know how to make shortcuts to files and folders... With the use of vb5stkit.dll its pretty easy. To make it really simple to use, i have put all the code into a module. If you don't have the dll, I have included the dll in the zip as "Vb5stkit.renametoDLL" so make sure you rename it and put it in your system directory! Hope this is very usefull for you all.
Well I have searched PSC in search on how to make a trainer, but none of them where comented enough, to tell how to do it. So I made this so you can learn from it. It is easy basic trainer making code. But I am working on a SD3 one but it is going to be awhile before it is done. Since it has Virtualy everything changable to be changed. The Tenchi Muyo RPG is to be used when in battle.
This code can, check for duplicates in a listbox, and remove them, it can sort a listbox (although my way is very hard to explain), it can shuffle the items in a listbox, and it can remove any item with a certain designated name from anywhere in the listbox, it's pretty cool, check it out!!!
Launch Date Faker and it will change the date (to a previous one if you want), launch an application, then change the date back to the current date. This can help delay evaluation periods for that stuborn piece of software that you haven't used for the last 2 months which says that the evaluation period is up even though has been pretty much unused. This is not a crack, it doesn't alter any files, and it isn't intended to be used in a malicious manner, but it can (and most likely will) help prolong your software evaluation period. Small, easy to understand file input/output code and date manipulation. Please rate and leave comments.