A preserved archive of the Logical Gamers community forums, 2009-2025. The original threads and posts, served read-only. Registration, posting and private messages are gone for good.

[C#]File Pumper Source

3.2k views · started by Bman ·
#1
[C#]File Pumper Source
Written by me, pumps files with bytes. Enjoy!

public void FilePump(string filepath,int amountofbytes)
{
if (filepath == "")
{
MessageBox.Show("You need a file to pump .-.");
}
else
{
var file = System.IO.File.OpenWrite(filepath);
int ii;
ii = 0;
while (ii < amountofbytes)
{
file.WriteByte(1);
ii = ii + 1;
}
MessageBox.Show("Done pumping sir.");

}
}
#2
using System.IO;


Learn to use using's. They help out and save lines of coding.
#3
Lol sorry bro. I have that in my code, just didnt wanna make people have a difficult time.
#4
                int ii;
ii = 0;


can just be
int ii = 0;


if (filepath == null)
{
MessageBox.Show("You need a file to pump .-.");
}

Fixed.