Sep 30, 2011 11:08 PM
(This post was last modified: Sep 30, 2011 11:37 PM by SIM-888979.)
~ ★ VB.NET File Pumper Tutorial ★ ~
Written by Unipire & Soul Collector for layout
==
Step 1:
Open Visual Basic:
Click File > Then New Project > Choose Windows Application> Write name: File Pumper > Click Ok button.
Insert two Text Boxes, and two Buttons.
Double click on the Button and rename it to Browse then paste this code into it.
Code
Dim ofd As New OpenFileDialog
ofd.Filter = "Exe Files|*.exe"
ofd.ShowDialog()
TextBox1.Text = ofd.FileNameExplanation:
What the button Browse does is that when clicked upon, an Open File Dialog would pop up, and the user of the program must choose an executable file they want to pump megabytes into.
Step 2:
Double click on the second Button and rename it to Pump and then paste this code into it.
Code
If TextBox2.Text = "" Then
MsgBox("Please put in the amount of megabytes you want to pump.")
Else
Dim file1 = File.OpenWrite(TextBox1.Text)
Dim siza = file1.Seek(0, SeekOrigin.[End])
Dim size = Convert.ToInt32(TextBox2.Text)
Dim bite As Decimal = size * 100
While siza < bite
siza += 1
file1.WriteByte(0)
End While
file1.Close()
MessageBox.Show("Your file has been pumped.")Explanation:
When the second button named Pump is clicked upon, the program would pump megabytes into the program, if no number is placed in Text Box 2, the program doesn't know how many megabytes does it need to pump, so if TextBox2.Text is blank, also known as "", a message would pop up telling them to put in a number.
And you're done.
==
lel


