R
Rathtap
My web app starts a process on a separate thread that is long running
while I display the user a please wait page. This process writes
continuously to a log file. It would be a good idea to display its
contents in the wait page so the user knows something is going on.
I tried the following in the page load event but I get errors because
the file is being written to.
private void Page_Load(object sender, System.EventArgs e)
{
Response.Write(@"<META HTTP-EQUIV=Refresh CONTENT=""3; URL=""> ");
FileInfo dFile = new FileInfo(file);
long filesize = dFile.Length;
long start = 0;
long end = filesize;
Response.WriteFile(file, start, end);
Response.End();
}
The error reads:
System.IO.IOException: The process cannot access the file
"C:\Trace.log" because it is being used by another process.
Any suggestions?
while I display the user a please wait page. This process writes
continuously to a log file. It would be a good idea to display its
contents in the wait page so the user knows something is going on.
I tried the following in the page load event but I get errors because
the file is being written to.
private void Page_Load(object sender, System.EventArgs e)
{
Response.Write(@"<META HTTP-EQUIV=Refresh CONTENT=""3; URL=""> ");
FileInfo dFile = new FileInfo(file);
long filesize = dFile.Length;
long start = 0;
long end = filesize;
Response.WriteFile(file, start, end);
Response.End();
}
The error reads:
System.IO.IOException: The process cannot access the file
"C:\Trace.log" because it is being used by another process.
Any suggestions?