Server Error in '/arc' Application.

The process cannot access the file 'E:\web\fer3com0\arc\out-data.txt' because it is being used by another process.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.IOException: The process cannot access the file 'E:\web\fer3com0\arc\out-data.txt' because it is being used by another process.

Source Error:


Line 34:   dim filname as string
Line 35:   filname = Server.MapPath("out-data.txt")   
Line 36:   OutStream = File.AppendText(filname)
Line 37:   OutStream.WriteLine(DateTime.UTCnow() +" "+ ipaddr)
Line 38:   OutStream.WriteLine(req0)

Source File: E:\web\fer3com0\arc\m2.aspx    Line: 36

Stack Trace:


[IOException: The process cannot access the file 'E:\web\fer3com0\arc\out-data.txt' because it is being used by another process.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +227
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +738
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +68
   System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost) +76
   System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost) +75
   System.IO.StreamWriter..ctor(String path, Boolean append) +39
   System.IO.File.AppendText(String path) +39
   ASP.m2_aspx.Page_Load(Object sender, EventArgs e) in E:\web\fer3com0\arc\m2.aspx:36
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4676.0