Display a file in Browser
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-io' list.


Tarapareddy, Sai
Hi,
I am trying to Display a text file in a browser ..? Which is better way...?

When I tried using the following way it is taking forever to load the file.

sr = System.IO.File.OpenText(strFileNm)
' Read each line in the file.
' When the end of the file is reached, return the value "-1".
Dim x As String
While sr.Peek <> -1
x = x & sr.ReadLine()
End While
txtLog.Text = x

One more question is which control is the better way to display a file....?
Here I am using Textbox....

Thank You,

Sai Krishna Tarapareddy
Data management
x58051
Click here to reveal e-mail address <mailto:Click here to reveal e-mail address>

***********************************************************************************
WARNING: All e-mail sent to and from this address will be received or
otherwise recorded by the A.G. Edwards corporate e-mail system and is
subject to archival, monitoring or review by, and/or disclosure to,
someone other than the recipient.
************************************************************************************
Reply to this message...
 
    
Peter Brunone
Sai,

Instead of ReadLine(), try using the ReadToEnd() method. You won't have
to loop, since the method returns the entire file from current position to
end.

Cheers,

Peter
-----Original Message-----
From: Tarapareddy, Sai [mailto:Click here to reveal e-mail address]
Sent: Tuesday, May 07, 2002 2:11 PM
To: ngfx-io
Subject: [ngfx-io] Display a file in Browser

Hi,

I am trying to Display a text file in a browser ..? Which is better
way...?

When I tried using the following way it is taking forever to load the
file.

sr = System.IO.File.OpenText(strFileNm)

' Read each line in the file.

' When the end of the file is reached, return the value "-1".

Dim x As String

While sr.Peek <> -1

x = x & sr.ReadLine()

End While

txtLog.Text = x

One more question is which control is the better way to display a
file....? Here I am using Textbox....

Thank You,

Sai Krishna Tarapareddy

Data management

x58051

Click here to reveal e-mail address

****************************************************************************
*******
WARNING: All e-mail sent to and from this address will be received or
otherwise recorded by the A.G. Edwards corporate e-mail system and is
subject to archival, monitoring or review by, and/or disclosure to,
someone other than the recipient.

****************************************************************************
********
| [ngfx-io] member Click here to reveal e-mail address = YOUR ID |
http://www.aspfriends.com/aspfriends/ngfx-io.asp = JOIN/QUIT
Reply to this message...
 
    
Tarapareddy, Sai
Hi,
How to give permissions to IUSER_Machine on a file or folder on remote
server...?

Thank You,

Sai Krishna Tarapareddy
Data management
x58051
Click here to reveal e-mail address <mailto:Click here to reveal e-mail address>

-----Original Message-----
From: Peter Brunone [mailto:Click here to reveal e-mail address]
Sent: Tuesday, May 07, 2002 6:03 PM
To: ngfx-io
Subject: [ngfx-io] RE: Display a file in Browser

Sai,

Instead of ReadLine(), try using the ReadToEnd() method. You won't have
to loop, since the method returns the entire file from current position to
end.

Cheers,

Peter
-----Original Message-----
From: Tarapareddy, Sai [mailto:Click here to reveal e-mail address]
Sent: Tuesday, May 07, 2002 2:11 PM
To: ngfx-io
Subject: [ngfx-io] Display a file in Browser
Hi,
I am trying to Display a text file in a browser ..? Which is better way...?

When I tried using the following way it is taking forever to load the file.

sr = System.IO.File.OpenText(strFileNm)
' Read each line in the file.
' When the end of the file is reached, return the value "-1".
Dim x As String
While sr.Peek <> -1
x = x & sr.ReadLine()
End While
txtLog.Text = x

One more question is which control is the better way to display a file....?
Here I am using Textbox....

Thank You,

Sai Krishna Tarapareddy
Data management
x58051
Click here to reveal e-mail address <mailto:Click here to reveal e-mail address>

****************************************************************************
*******
WARNING: All e-mail sent to and from this address will be received or
otherwise recorded by the A.G. Edwards corporate e-mail system and is
subject to archival, monitoring or review by, and/or disclosure to,
someone other than the recipient.
****************************************************************************
********
| [ngfx-io] member Click here to reveal e-mail address = YOUR ID |
http://www.aspfriends.com/aspfriends/ngfx-io.asp = JOIN/QUIT
| [ngfx-io] member Click here to reveal e-mail address = YOUR ID |
http://www.aspfriends.com/aspfriends/ngfx-io.asp = JOIN/QUIT
Reply to this message...
 
 
System.IO.File




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com