Displaying a text file

  • Thread starter Thread starter jlea
  • Start date Start date
J

jlea

Does anyone know of a nice little .NET class that throws the contents of a
supplied file to a scrollable window/form/control?
 
Why not use a StreamReader and dump the contents to a multi-line text box?

StreamReader reader = new StreamReader("c:\\somefile.txt");
this.textBox1.Text = reader.ReadToEnd();
reader.Close();

-Joel

--------------------
From: "jlea" <[email protected]>
Subject: Displaying a text file
Date: Wed, 27 Apr 2005 10:50:08 -0700
Lines: 4
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.languages.csharp
NNTP-Posting-Host: h-66-166-201-170.snvacaid.covad.net 66.166.201.170
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP1
4.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.languages.csharp:323448
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

Does anyone know of a nice little .NET class that throws the contents of a
supplied file to a scrollable window/form/control?

This reply is provided AS IS, without warranty (express or implied).
 
Back
Top