11-01-2010, 09:38 AM
this is also a good tutorial for beginners.
oke lets get started.
File -> New Project -> Windows Application -> “File Pumper” -> Ok
add the following from your toolbox
button 1 : open
button 2 : PUMP
make it look like this.
add this code for the open button.
and this code for the pump button.
if you compress the file .ZIP, .RAR, ect It will go back to the original size.
now you made your own first file pumper
oke lets get started.
File -> New Project -> Windows Application -> “File Pumper” -> Ok
add the following from your toolbox
Code:
TextBox1
NumericUpDown1
RadioButton1
RadioButton2
Button1
Button2
button 1 : open
button 2 : PUMP
make it look like this.
add this code for the open button.
Code:
Dim ofd As New OpenFileDialog
ofd.Filter = "Exe Files|*.exe"
ofd.ShowDialog()
TextBox1.Text = ofd.FileName
and this code for the pump button.
Code:
sfd.Filter = "Exe Files|*.exe"
sfd.ShowDialog()
Dim filesize As Double = Val(NumericUpDown1.Value)
IO.File.Copy(TextBox1.Text, sfd.FileName)
If RadioButton1.Checked Then
filesize = filesize * 1024
End If
If RadioButton2.Checked Then
filesize = filesize * 1048576
End If
Dim filetopump = IO.File.OpenWrite(sfd.FileName)
Dim size = filetopump.Seek(0, IO.SeekOrigin.[End])
While size < filesize
filetopump.WriteByte(0)
size += 1
End While
filetopump.Close()
MsgBox("Successfully Pumped!")
if you compress the file .ZIP, .RAR, ect It will go back to the original size.
now you made your own first file pumper