Re: Is there a way to keep the StreamWriter open?
- From: "Patrice" <http://www.chez.com/scribe/>
- Date: Wed, 17 Jun 2009 09:56:49 +0200
Hi,
The web server is already able to log this information (see the IIS
logging). Else
http://james.newtonking.com/archive/2007/06/05/enterprise-library-logging-vs-log4net.aspx
could be usefull. AFAIK in most cases, output is buffered and flushed in a
single go instead of being written immediately...
--
Patrice
"Bishop" <nospam@xxxxxxxxxx> a écrit dans le message de groupe de discussion
: 1DC4274B-9BBD-44E6-90B1-004467F91476@xxxxxxxxxxxxxxxx
Here is my current code:
Imports System.IO
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Dim FILENAME As String =
"C:\inetpub\wwwroot\zzJunkWriteTextFile\Log\output.csv"
Dim objStreamWriter As StreamWriter
objStreamWriter = File.AppendText(FILENAME)
objStreamWriter.WriteLine(Request.RawUrl & "," &
DateTime.Now.ToString())
objStreamWriter.Close()
End Sub
End Class
Every time some hits this page it writes a line to a text file. I wanted
to find out if I can keep the StreamWriter open to speed up the process?
.
- References:
- Is there a way to keep the StreamWriter open?
- From: Bishop
- Is there a way to keep the StreamWriter open?
- Prev by Date: RE: Temporary ASP.NET Files Corruption
- Next by Date: Re: enum or static class
- Previous by thread: Is there a way to keep the StreamWriter open?
- Next by thread: Re: Is there a way to keep the StreamWriter open?
- Index(es):
Relevant Pages
|