فایل پمپر
کد PHP:
using System;
using System.ComponentModel;
using System.IO;
using System.Windows.Forms;
namespace AddBytes
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
var file = File.OpenWrite(textBox1.Text);
var siza = file.Seek(0, SeekOrigin.End);
var size = Convert.ToInt32(textBox2.Text);
if (radioButton1.Checked)
{
decimal bite = size*1048576;
while (siza < bite)
{
siza++;
file.WriteByte(0);
}
file.Close();
}
else if (radioButton2.Checked)
{
decimal bite = size*1048;
while (siza < bite)
{
siza++;
file.WriteByte(0);
}
file.Close();
}
MessageBox.Show("Done !");
}
private void button2_Click(object sender, EventArgs e)
{
openFileDialog1.DefaultExt = "exe";
openFileDialog1.****** = "exe files (*.exe)|*.exe";
openFileDialog1.FilterIndex = 1;
if (openFileDialog1.ShowDialog(this) == DialogResult.OK)
{
textBox1.Text = string.Empty;
textBox1.Text = openFileDialog1.FileName;
}
}
}
}