Displaying a text file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jlea

    Displaying a text file

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


  • Joel Hendrix [MSFT]

    #2
    RE: Displaying a text file

    Why not use a StreamReader and dump the contents to a multi-line text box?

    StreamReader reader = new StreamReader("c :\\somefile.txt ");
    this.textBox1.T ext = reader.ReadToEn d();
    reader.Close();

    -Joel

    --------------------[color=blue]
    >From: "jlea" <jon@leapsoft.c om>
    >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: <ei$jWF1SFHA.25 48@TK2MSFTNGP14 .phx.gbl>
    >Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
    >NNTP-Posting-Host: h-66-166-201-170.snvacaid.co vad.net 66.166.201.170
    >Path:[/color]
    TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA01.phx.gbl!T K2MSFTNGP08.phx .gbl!TK2MSFTNGP 1
    4.phx.gbl[color=blue]
    >Xref: TK2MSFTNGXA02.p hx.gbl microsoft.publi c.dotnet.langua ges.csharp:3234 48
    >X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
    >
    >Does anyone know of a nice little .NET class that throws the contents of a
    >supplied file to a scrollable window/form/control?
    >
    >
    >[/color]

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

    Comment

    Working...