Results 1 to 3 of 3

Thread: [Resolved] Streamwriter to create dummy file?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2001
    Location
    Maumelle, AR
    Posts
    624

    [Resolved] Streamwriter to create dummy file?

    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.
    Last edited by hipopony66; Feb 20th, 2009 at 10:11 AM.

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Streamwriter to create dummy file?

    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

  3. #3
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: Streamwriter to create dummy file?

    Code:
    Using w As New IO.FileStream( _
        "C:\Users\Maximilian\Desktop\Test.dummy", _
        IO.FileMode.Create _
    )
        w.SetLength(64000)
    End Using
    This creates a file that is 64kb long but doesn't contain any information.
    Last edited by MaximilianMayrhofer; Feb 19th, 2009 at 11:52 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width