![]() |
|
How To Make A File Pumper [VB.NET] - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Coding (https://sinister.li/Forum-Coding) +--- Forum: Visual Basic & .NET Framework (https://sinister.li/Forum-Visual-Basic-NET-Framework) +--- Thread: How To Make A File Pumper [VB.NET] (/Thread-How-To-Make-A-File-Pumper-VB-NET) |
How To Make A File Pumper [VB.NET] - Blue - 07-06-2013 This is a tutorial on how to make a fully working File Pumper!
It is pretty simple and will probable help a lot of you out! 1. Make a new form. Name it "File Pumper" or whatever you prefer. 2. Put the following things in Form1. 1x Textbox 2x Button 2x Radio Button 1x NumericUpDown 3. Set the following text for the following things: Button1 = Browse Button2 = Pump! RadioButton1 = Kilobyte RadioButton2 = Megabyte Here is the layout I used, You do not have too of course. ![]() 4. Double click the Open button & add the following code. Code: Dim ofd As New OpenFileDialog
ofd.Filter = "Exe Files|*.exe"
ofd.ShowDialog()
TextBox1.Text = ofd.FileName5. Double click the Pump button & add the following code. Code: Dim sfd As New SaveFileDialog
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!")That is a easy way to make a File Pumper! Enjoy! RE: How To Make A File Pumper [VB.NET] - Helroos - 07-06-2013 While size is lower than selected size, add a byte. Nice method, thanks for sharing
RE: How To Make A File Pumper [VB.NET] - Blue - 07-06-2013 Thank you, Enjoy!
|