J
John Carnahan
Using .net in aspx page with following code, and get a write error on the
website, but everything works fine on the development machine.
----- code ----
Dim counter As String = CType(logcount, String)
Dim fileName As String = mPath + mFileName
Dim Fs As System.IO.FileStream = New System.IO.FileStream(fileName,
IO.FileMode.OpenOrCreate, IO.FileAccess.Write)
Try
Dim Sw As System.IO.StreamWriter = New
System.IO.StreamWriter(Fs)
Sw.Write(counter)
Sw.Flush()
Sw.Close()
-- error page returned from website ----
Server Error in '/' Application.
Access to the path
"\\premfs6\sites\premium5\michaelcarlin\webroot\MCP\VisitCount2.txt" is
denied.
Stack Trace:
[UnauthorizedAccessException: Access to the path
"\\premfs6\sites\premium5\michaelcarlin\webroot\MCP\VisitCount2.txt" is
denied.]
System.IO.__Error.WinIOError(Int32 errorCode, String str) +393
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean
bFromProxy) +859
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
+43
MCP._default.WriteLogCnt()
MCP._default.Logger()
MCP._default.Page_Load(Object sender, EventArgs e)
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +29
System.Web.UI.Page.ProcessRequestMain() +724
website, but everything works fine on the development machine.
----- code ----
Dim counter As String = CType(logcount, String)
Dim fileName As String = mPath + mFileName
Dim Fs As System.IO.FileStream = New System.IO.FileStream(fileName,
IO.FileMode.OpenOrCreate, IO.FileAccess.Write)
Try
Dim Sw As System.IO.StreamWriter = New
System.IO.StreamWriter(Fs)
Sw.Write(counter)
Sw.Flush()
Sw.Close()
-- error page returned from website ----
Server Error in '/' Application.
Access to the path
"\\premfs6\sites\premium5\michaelcarlin\webroot\MCP\VisitCount2.txt" is
denied.
Stack Trace:
[UnauthorizedAccessException: Access to the path
"\\premfs6\sites\premium5\michaelcarlin\webroot\MCP\VisitCount2.txt" is
denied.]
System.IO.__Error.WinIOError(Int32 errorCode, String str) +393
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean
bFromProxy) +859
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
+43
MCP._default.WriteLogCnt()
MCP._default.Logger()
MCP._default.Page_Load(Object sender, EventArgs e)
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +29
System.Web.UI.Page.ProcessRequestMain() +724