Results 1 to 3 of 3

Thread: [02/03] How do I use Open statement?

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    9

    Question [02/03] How do I use Open statement?

    How do I do the following?

    Open (TextBox1.Text) for Output as #1
    Print "Hello World "+(TextBox2.Text), #1
    Close #1

    Thanx.

    Is the syntax of VB Studio.Net very different from Classical VB?
    Last edited by pcpage4; May 10th, 2006 at 04:05 PM. Reason: 1

  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: [02/03] How do I use Open statement?

    yes, they have vastly improved file IO in .NET

    VB Code:
    1. Dim SWriter As System.IO.StreamWriter
    2.         Try
    3.             SWriter = New System.IO.StreamWriter(textbox1.Text)
    4.             SWriter.WriteLine("Hello World " & textbox2.text)
    5.         Catch ex As Exception
    6.             MessageBox.Show(ex.Message)
    7.         Finally
    8.             If Not SWriter Is Nothing Then
    9.                 SWriter.Close()
    10.                 SWriter = Nothing
    11.             End If
    12.         End Try

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    9

    Re: [02/03] How do I use Open statement?

    I have alot to learn. Thank you.
    Last edited by pcpage4; May 10th, 2006 at 04:45 PM.

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