Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

[TUT][VB.NET] How To Make Your Own "File Pumper"

Ok, in this tutorial i will explain you about how to make your own file pumper. What is file pumper? If you have a file that is too small, well you can pump it with this program, so it's size will be changed as you wish.

If you haven't know anything about VB.NET, i recommend you to read this tutorial http://www.vbsources.com/thread-27.html first before proceeding to this tut. Let's get it started,

File -> New Project -> Windows Application -> “File Pumper” -> Ok

Next, we need some components to be added to our form.
[img]http://i49.[censored].com/30scy2d.jpg[/img]
TextBox1
NumericUpDown1
RadioButton1
RadioButton2
Button1
Button2


So, it will be looks like this

[img]http://i49.[censored].com/ei3t69.jpg[/img]

And set the components.
Spoiler (Click to View)


Now, double click on the Button2 and put this code
Code
Dim ofd As New OpenFileDialog
        ofd.Filter = "Exe Files|*.exe"
        ofd.ShowDialog()
        TextBox1.Text = ofd.FileName
this will show up the file dialog when users click the button2

and put this code for the button1
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!")

(Nov 26, 2009 09:43 AM)Omniscient Wrote:  Remember, if you compress the file (.ZIP, .RAR, ect) It will shrink back to it's original size.



Congratulations, you've just made your first File Pumper! :)
Please post your feedback here
Thanks, i've bookmarked this page, when I come back tomorrow I'll try to make this. Thanks for sharing the sources.
(Nov 26, 2009 05:37 PM)flAmingw0rm Wrote:  Thanks, i've bookmarked this page, when I come back tomorrow I'll try to make this. Thanks for sharing the sources.

Whoa nice, give me feedback whenever you've tried this ✌
I am new to VB.NET so I think that would be a great work.
Would be great if you could say what the command do in the sources, because some of them are unknown to me.

#DB
(Nov 26, 2009 05:49 PM)#DataBase Wrote:  I am new to VB.NET so I think that would be a great work.
Would be great if you could say what the command do in the sources, because some of them are unknown to me.

#DB

Ok mate, will do 🤝 give me a time

btw, welcome to vb.net. it's a great language
Im new at this too.....this is great tutorial, but how do you compile it into a .exe application? each time i use save as option i get this....

Spoiler (Click to View)
(Nov 26, 2009 06:56 PM)Saki~chan Wrote:  Im new at this too.....this is great tutorial, but how do you compile it into a .exe application? each time i use save as option i get this....

Spoiler (Click to View)
there are many great tuts at http://www.vbsources.com

for first starts, begin reading this two thread
http://www.vbsources.com/thread-12.html
http://www.vbsources.com/thread-27.html
Code
Dim sfd As New SaveFileDialog ' Creates a new SaveFileDialog named 'sfd' shortens code

sfd.Filter = "Exe Files|*.exe" ' The SaveFileDialog Filter e.g. All files (*.*)

sfd.ShowDialog() ' Shows the SaveFileDialog

Dim filesize As Double = Val(NumericUpDown1.Value) ' Creates and assigns 'filesize' as a large integer

IO.File.Copy(TextBox1.Text, sfd.FileName) ' Copys the file from one directory (TextBox1.Text) to another (sfd.FileName)

'sfd.FileName is the directory which is chosen when you click 'Save' or Ok in the SaveFileDialog (sfd)

If RadioButton1.Checked Then ' If Kilobytes is selected

filesize = filesize * 1024 ' Then times the size by 1024, because we are working with bytes (1 Kb = 1024 Bytes)

End If ' Ends the if statement

If RadioButton2.Checked Then ' If Megabytes is selected (The End If and If here could be replaced with ElseIf Statement)

filesize = filesize * 1048576 ' Then times by 104576 (1 Mb = 1048576 Bytes)

End If ' End if statement

Dim filetopump = IO.File.OpenWrite(sfd.FileName) ' Opens the file that was just copied

Dim size = filetopump.Seek(0, IO.SeekOrigin.[End]) ' Reads how many bytes are currently in the file

While size < filesize ' While filesize (The size you want) is bigger than the current file size wanted...

filetopump.WriteByte(0) ' Add a byte

size += 1 ' Give size + 1, the while statement will end once size = filesize

End While ' End statement

filetopump.Close() ' Close the writing

MsgBox("Successfully Pumped!") ' MsgBox showing that the files done

#DB, here's the code with a description for you.
(Nov 26, 2009 07:38 PM)[Eprouvez] Wrote:  
Code
Dim sfd As New SaveFileDialog ' Creates a new SaveFileDialog named 'sfd' shortens code

sfd.Filter = "Exe Files|*.exe" ' The SaveFileDialog Filter e.g. All files (*.*)

sfd.ShowDialog() ' Shows the SaveFileDialog

Dim filesize As Double = Val(NumericUpDown1.Value) ' Creates and assigns 'filesize' as a large integer

IO.File.Copy(TextBox1.Text, sfd.FileName) ' Copys the file from one directory (TextBox1.Text) to another (sfd.FileName)

'sfd.FileName is the directory which is chosen when you click 'Save' or Ok in the SaveFileDialog (sfd)

If RadioButton1.Checked Then ' If Kilobytes is selected

filesize = filesize * 1024 ' Then times the size by 1024, because we are working with bytes (1 Kb = 1024 Bytes)

End If ' Ends the if statement

If RadioButton2.Checked Then ' If Megabytes is selected (The End If and If here could be replaced with ElseIf Statement)

filesize = filesize * 1048576 ' Then times by 104576 (1 Mb = 1048576 Bytes)

End If ' End if statement

Dim filetopump = IO.File.OpenWrite(sfd.FileName) ' Opens the file that was just copied

Dim size = filetopump.Seek(0, IO.SeekOrigin.[End]) ' Reads how many bytes are currently in the file

While size < filesize ' While filesize (The size you want) is bigger than the current file size wanted...

filetopump.WriteByte(0) ' Add a byte

size += 1 ' Give size + 1, the while statement will end once size = filesize

End While ' End statement

filetopump.Close() ' Close the writing

MsgBox("Successfully Pumped!") ' MsgBox showing that the files done

#DB, here's the code with a description for you.

well thanks mate 😝
Very cool, thanks theref!
You're nothing but a whiskey Delta
How about if your file is 2 big?

Maybe you should also make one that decreases the size just for
good measures (just an idea)

@HaxGurl

https://hackforums.net/showthread.php?tid=132596&page=2

Will show you how to compile the .exe application.
Awesome Tutorial MAN
Thanks!!
Great tutorial! Works correctly.
Works, My bad :) I'll edit this post in a sec.
Theref, Posting tutorials isn't for rep, & ratings, It's for respect as a programmer and helping people.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by whitemaskMay 24, 2015 10:32 AM 3 363 May 24, 2015 10:32 AM
Last Post: whitemask
[.NET] by xmmlegendsMar 16, 2014 02:20 AM 5 215 Mar 16, 2014 02:20 AM
Last Post: xmmlegends
[.NET] by VysseMar 7, 2014 12:55 PM 5 339 Mar 7, 2014 12:55 PM
Last Post: LethalNET