Below is a very small VB6 code snippet. It allows you to delete a file from the hard drive. To try out this Visual Basic code snippet first go to your hard drive and create a new text file on the C drive. Call the file test.txt and fill it with some junk data. Now create a new Visual Basic program. On the main form add a command button. Double click the command button to get to the click event code. Add the following inside the click event handler
Obviously in a real world application you would not hard code in the file name but for simplicity sake we did so here. They key to getting rid of the file is the Kill Filename command. This is left over from the old original dos days but it still works today.
This was a very basic example to give you a taste of what VB6 allows you to do in relation to File handling. We also have a whole list of VB6 File Handling Tutorials located on this site. Feel free to check them out to learn much more about dealing with files in VB.
Note: The source for this was found at DreamVB which is no longer online.
I always wrap my Kill
I always wrap my Kill commands in on "error resume next / on error goto 0" blocks. There's always the chance the file may get deleted before your kill command can execute.
craftmatic prices According
craftmatic prices
According to Wiki, the cars acclimatized a Vagrant machine in 4 or 6 cylinder forms which came from the 1948 P3 and had transparency valves for cove and side valves for exhaust. A four-speed guide dissemination was occupied with a column-mounted shifter at first and floor-mounted unit from 1954. At cardinal the gearbox exclusive had synchromesh on third and supreme but it was added to second gear as obviously in 1953. A liberated veer dominance, a standard Tourist memorable part, was fitted to cars without overdrive until more 1959.
There is another one....
There is another one.... It's more simple than this code.
Delete A File - Snippet
I try this code but there's an error..
Kill Filename is that a command?? because when i try the code above the Kill Filename is error
Post new comment