Private Sub btnBeowser_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBeowser.Click
Dim ofd As New OpenFileDialog
ofd.Filter = "Exe Files|*.exe"
ofd.ShowDialog()
txtFileName.Text = ofd.FileName
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
rbtnMegaByte.Checked = True
End Sub
Private Sub btnPump_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPump.Click
Dim sfd As New SaveFileDialog
sfd.Filter = "Exe Files|*.exe"
sfd.ShowDialog()
Dim filesize As Double = Val(NumericUpDown1.Value)
IO.File.Copy(txtFileName.Text, sfd.FileName)
If rbtnKbByte.Checked Then
filesize = filesize * 1024
End If
If rbtnMegaByte.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("용량 올리기 완료")