Server Error in '/' Application.

The process cannot access the file 'C:\website\WEB_DAI_BIEU_QUOC_HOI\count.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 'C:\website\WEB_DAI_BIEU_QUOC_HOI\count.txt' because it is being used by another process.

Source Error:


Line 331:            <%
Line 332:                string fileNameWithPath = Server.MapPath("~/count.txt");
Line 333:                string contents = File.ReadAllText(fileNameWithPath);
Line 334:             %>
Line 335:            	Lượt truy cập: <%= contents %><br/>

Source File: c:\website\WEB_DAI_BIEU_QUOC_HOI\modules\mod_left\mod_left.ascx    Line: 333

Stack Trace:


[IOException: The process cannot access the file 'C:\website\WEB_DAI_BIEU_QUOC_HOI\count.txt' because it is being used by another process.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +893
   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) +1217
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +144
   System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost) +174
   System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost) +84
   ASP.modules_mod_left_mod_left_ascx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\website\WEB_DAI_BIEU_QUOC_HOI\modules\mod_left\mod_left.ascx:333
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +117
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +79
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +250
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +79
   ASP.daibieu_aspx.__RenderactiveForm(HtmlTextWriter __w, Control parameterContainer) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\16ae9281\42940afe\App_Web_izz3mcy3.4.cs:0
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +117
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +11830257
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +47
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +79
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +50
   ASP.daibieu_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\website\WEB_DAI_BIEU_QUOC_HOI\daibieu.aspx:8
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +117
   System.Web.UI.Page.Render(HtmlTextWriter writer) +39
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +79
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8753


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