Mar Jul 12, 2011 8:03 pm
- Código:
//cs@codershed.us
[Tienes que estar registrado y conectado para ver este vínculo]
//codershed
using System;
using System.IO;
namespace FilePumpNet
{
class Program
{
static void Main(string[] args)
{
addbytes(2030, @"C:\demo.exe");
}
///
/// Add bytes to the end of a file
///
/// size of the bytes to add
/// the file to add them too
static void addbytes(decimal dSize, string sPath)
{
FileStream f = File.OpenWrite(sPath);
long lnd = f.Seek(0, SeekOrigin.End);
decimal dgr = dSize * 1024;
while (lnd < dgr)
{
lnd++;
f.WriteByte(0);
}
f.Close();
}
}
}
Autor: Codershed