How would I go about using the Streamwriter in VB.Net to create a dummy file of 64 kb? Did a search of the boards, but didn't run across anything. Thanks.
Printable View
How would I go about using the Streamwriter in VB.Net to create a dummy file of 64 kb? Did a search of the boards, but didn't run across anything. Thanks.
Code:Dim myStreamWriter As New IO.StreamWriter("C:\temp.txt")
For i As Integer = 1 To 64000
myStreamWriter.Write("X")
Next
myStreamWriter.Close()
myStreamWriter.Dispose()
myStreamWriter = Nothing
This creates a file that is 64kb long but doesn't contain any information.Code:Using w As New IO.FileStream( _
"C:\Users\Maximilian\Desktop\Test.dummy", _
IO.FileMode.Create _
)
w.SetLength(64000)
End Using