Vb.Net-Informations.com

  How to VB.NET TextWriter




   Categories

    HOME
    VB.NET
    CSHARP

 
   














How to VB.NET TextWriter

Textreader and TextWriter are the another way to read and write file respectively, even though these are not stream classes. The StreamReader and StreamWriter classes are derived from TextReader and TextWriter classes respectively. The following sample source showing how write in a file using TextWriter .


         VB.NET Source Code Download           Print Source Code
         How to VB.NET TextWriter - Download
        
VB.Net Tutorial

Imports System.IO
Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, _
                ByVal e As System.EventArgs) Handles Button1.Click
        Try
            Dim writeFile As System.IO.TextWriter = New _
            StreamWriter("c:\textwriter.txt")
            writeFile.WriteLine("vb.net-informations.com")
            writeFile.Flush()
            writeFile.Close()
            writeFile = Nothing
        Catch ex As IOException
            MsgBox(ex.ToString)
        End Try
    End Sub
End Class

When you execute this source code , you will get a file TextWriter.txt and inside it written vb.net-informations.com .

VB.NET Files Related Contents
*     How to VB.NET Directory operations
*     How to VB.NET File operations
*     How to VB.NET FileStream
*     How to VB.NET TextReader
*     How to VB.NET Simple TextReader
*     How to VB.NET BinaryReader
*     How to VB.NET BinaryWriter

VB.Net Related Topics
*     Microsoft .Net Framework Tutorials
*     VB.NET Language Basics Tutorials
*     VB.NET Program Flow Control Tutorials
*     VB.NET Collections Tutorials
*     VB.NET String Tutorials
*     VB.NET Files Tutorials
*     VB.NET Excel 2007 Tutorials
*     VB.NET Crystal Reports Tutorials
*     VB.NET Communications Tutorial
*     VB.NET ADO.NET Tutorial with source code
*     ADO.NET Data Providers help and Tutorial
*     VB.NET ADO.NET Dataset Tutorial
*     ADO.NET DataAdapter and Dataset
*     VB.NET ADO.NET DataView Tutorial
*     VB.NET Remoting Tutorial
*     VB.NET XML Tutorial
Search here for more CSharp Source Code :

  |  Home   |  SiteMap   |  About   |
net-informations.com (C) 2010 All Rights Reserved