VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Spin HardDrive

by Wanna-Sk8er (7 Submissions)
Category: Jokes/Humor
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (5 Votes)

Have you ever had a progressbar or something on your app and you want users to think its doing something really hard.. This will spin your HD so you can get that effect...

Rate Spin HardDrive

'Note: Place a command button named "Command1" on a form...
Private Sub Command1_Click()
Dim fileblock(60000000) As Byte
'opens a file to output to
Open "c:\windows\temp\tempfile.dat" For Binary As #1
'creates a massive string to write to the file
For i = 1 To 1000000
fileblock(i) = 1
Next i
'this is the loop. it keeps going until the file reaches the size you set in the txtfilesize box
Do Until LOF(1) > txtfilesize
Put #1, , fileblock
DoEvents
Loop
'closes the file
Close #1
'this deletes the file you just made
Kill "c:\windows\temp\tempfile.dat"
End Sub

Download this snippet    Add to My Saved Code

Spin HardDrive Comments

No comments have been posted about Spin HardDrive. Why not be the first to post a comment about Spin HardDrive.

Post your comment

Subject:
Message:
0/1000 characters