VB icon

A 'Dummy' File Generator

Email
Submitted on: 1/5/2015 5:34:00 AM
By: Im_[B]0ReD (from psc cd)  
Level: Intermediate
User Rating: By 2 Users
Compatibility: VB 5.0, VB 6.0
Views: 1980
 
     generates a 'dummy' file which can be any type and any number of kilobytes. 110% commented just like my code 'A+ Secure Delete'. purpose is to generate files, so not much of a purpose. i just saw it in a couple of hacking/security programs and thought i'd try it.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: A 'Dummy' File Generator
' Description:generates a 'dummy' file which can be any type and any number of kilobytes. 110% commented just like my code 'A+ Secure Delete'. purpose is to generate files, so not much of a purpose. i just saw it in a couple of hacking/security programs and thought i'd try it.
' By: Im_[B]0ReD (from psc cd)
'**************************************

Function GenerateDummyFile(Path As String, LengthInKB As Long)
'This function is used to Generate A "Dummy File"
'(it's a file that's only purpose is to do absolutely
'nothing).
On Error Resume Next 'If we get an error, keep going
Dim GeneratedByte As Byte, Generate As Integer 'the variables
Open Path For Binary Access Write As #1 'Open the "Dummy Path" so we can write to it
For Generate = 1 To LengthInKB * 1024 'this is the loop to that does 2 things...
'1) goes from 1 to the length in KiloBytes (to add to the file)
'2) converts bytes to KiloBytes By Multiplying The Size in KB * 1024 (the size of on KB in bytes)
Put #1, , GeneratedByte 'put the generated byte into the "Dummy File"
Next Generate 'stop the loop
MsgBox "Done!"
End Function


Other 4 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.