Results for "Category: Files"
This sample code show beginner how to use OpenFileDialog and SaveFileDialog with TextBox.
Just to show how to read a txt or .dat file in vb.net
The Tutorial aims at acquainting beginners, of each and every file and directory operations. I have given my main emphasis to reduce complexity and length of code. I am sure you will find it useful. "Please Vote". ;-) Kart
The Tutorial set sights on Accustoming VB Net Developers with sophisticated File Functions. However main weight is rest on Reducing Code complexity. I strongly believe Code that is easy to Understand works better. I am sure you will find it useful. Please Vote and Make my day ;-) Karthik
To save an Embedded Resource and save to file. This will take any embedded resource and save it to any filename you want.
Associating file types(file extension) to Your Application in .NET.This concept had been tedious or complex process in the past for programmers. But with .NET this has been made easy and flexible.You can associate a new file type (extension) or an existing file (like gif,jpg,bmp etc) to your application easily. you can refer http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vbtskaddingdeletingdocumenttypesassociatedfileextensions.asp for understanding.I have submitted an example of how to do this. This is photo viewer .If you install this project,you can open the existing GIF files with this program in your system.You can also associate JPG,BMP and other types also.
The following code sample illustrates how to search from a given directory downward through the entire directory tree. The sample output from this example is directed to the system debug screen. For this example, the first class member (below) is called by a menu item. After the search is finished, a message box pops up. http://www.concentric.net/~cgalbrai/dirsrh.shtml
Memory mapping is a powerful mechanism Win32 provides to implement shared memory and also to access files though a simple memory pointer without having to implement your own home brewed buffering mechanisms. As an example its as simple as calling void* lpData = mmf.Open(); CharUpperBuff((char*) lpData, mmf.GetLength()); to convert a file (of any length) to upper case. Areas where you might find this of interest include very large database files with fixed records, audio processing, string operations and image processing. The other side of memory mapped files is to implement shared memory. As you will probably know, Win32 puts each process into its own address space, thus making it impossible to pass ordinary pointers across process boundaries. With memory mapped files you get back this very useful mechanism. The enclosed zip file contains the CMemMapFile source code and a simple dialog based application which demonstrates all the functionality of the class. For further details about the example program have a look at the BOOL CTestmemmapApp::InitInstance() function and the CDialog1 member functions both in testmemmap.cpp PJ Naughter at http://indigo.ie/~pjn/index.html
This is a slightly more advanced topic than what I have covered so far, but I think that it is useful, and I think it will be useful to many people. File i/o is basically reading, and writing files. This lesson will only cover text files, that is, files that are readable through a text editor, as opposed to binary files(exes for example). It will not cover a great deal, for example, this lesson will not deal with searching files or reading specific data from files. It will merely be concerned with opening, writing, and reading text files. Don't worry though, lesson 11 will cover much more on this topic.
The code helps to Dial a phone number if a Voice modem is attached to the system. It waits for incomming calls and displays status of the calls. It uses TAPI API calls to intialize and open line and monitors the line for any event to take place. All the events like phone ringing, incomming call etc. are reported to the user
This program allows you to find a file or a directory in a specified drive (e.g. your hard disk, a floppy, your cd-rom...). It search for it in all the directories you have in that drive. Click Luke to go to my Web Page: other source code available...
Generic structure disk file manipulations. These functions form a basic template for reading and writing structures to a sequential file. This template is probably most useful for files with 500 or less records and eliminates the need for a more elaborate file handler such as C-Tree, DB-Vista, Mix etc. Routines to put data in the struct is out of scope here. Written by Lynn Nash 8/28/91 and donated to the public domain.
Generic configuration file handler.
MAXIMUM SECURITY (CDynamicEncrypt) Is really a simple class it inherits the CFile class of MFC and override Write, Read & Seek functions so that you can use them normally. but the data that is saved or read is encrypted and decrypted at the run-time, YOU DONT NEED TO ENCRYPT YOUR FILE AFTER YOU FINISHED ALL OF IT. YOU DONT NEED TO DECRYPT IT AT ALL IN ORDER TO READ IT. Thinks about it when saving sound and bitmaps of your product encrypted all the time and you use the normal classes you already use that utilizes the CFile class to read these encrypted files.
Encodes files with a password you choose and decodes them back if runned again with the same password. If you like this program, I would be glad if you rated it for me to know how many users like this program.
This code shows the size of any given file in bytes,K/bytes and M/bytes....
Get .exe file header info
This demonstrates an example of C++'s fstream File I/O. Very simple; the basic stuff for beginners to learn from. If you would like to see how to do something more in the direction this code leads, comment on (and rate) it telling me what specifically you want to see and I'll be glad to suffice.
For circular logging System
a class to make using fstream easier. NOTE: after a call to openfile() it is HIGHLY recomended to call closefile()