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\MC P\VisitCount2.txt" is
denied.
Stack Trace:
[UnauthorizedAccessException: Access to the path
"\\premfs6\sites\premium5\michaelcarlin\webroot\MC P\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 2 7189
Normally web sites run under the ASPNET user account.
It appears that this account does not have write privileges to the file path
you've specified.
--
I hope this helps,
Steve C. Orr, MCSD http://Steve.Orr.net
"John Carnahan" <ca********@msn.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl... 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\MC P\VisitCount2.txt" is denied.
Stack Trace: [UnauthorizedAccessException: Access to the path "\\premfs6\sites\premium5\michaelcarlin\webroot\MC P\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
Thanks Steve
"Steve C. Orr, MCSD" <St***@Orr.net> wrote in message
news:O$**************@TK2MSFTNGP11.phx.gbl... Normally web sites run under the ASPNET user account. It appears that this account does not have write privileges to the file
path you've specified.
-- I hope this helps, Steve C. Orr, MCSD http://Steve.Orr.net
"John Carnahan" <ca********@msn.com> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl... 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\MC P\VisitCount2.txt" is denied.
Stack Trace: [UnauthorizedAccessException: Access to the path "\\premfs6\sites\premium5\michaelcarlin\webroot\MC P\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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Bryan |
last post by:
i'm curious to know how others handle the closing of files. i seem to
always end up with this pattern even though i rarely see others do it.
f1 = file('file1')
try:
# process f1
finally:...
|
by: Hans-Joachim Widmaier |
last post by:
Hi all.
Handling files is an extremely frequent task in programming, so most
programming languages have an abstraction of the basic files offered by
the underlying operating system. This is...
|
by: Tom |
last post by:
I am having trouble when I read a file and another process
is trying to update it.
So I need a rountine to copy a file in asp.net.
Can anyone assist?
Thanks
Tom
|
by: Lokkju |
last post by:
I am pretty much lost here - I am trying to create a managed c++
wrapper for this dll, so that I can use it from c#/vb.net, however, it
does not conform to any standard style of coding I have seen....
|
by: martin |
last post by:
Hi,
I have noticed that every aspx page that I created (and ascx file) has an
assosiated resource file aspx.resx.
However what I would like to do is have a single global resource file for
the...
|
by: HNguyen |
last post by:
Hi,
I have a Web application in ASP.NET. My Application allows the users upload
files into the server after checking their user names and passwords. For
each transaction, the Web program will...
|
by: Jennifer |
last post by:
On an ASP page I've got some code that is supposed to "export" data in
a grid to an Excel file. What I'm doing is writing all the data to a
text file, separating the fields by commas. Then I'll...
|
by: ZWeng |
last post by:
I created a windows service using FileSystemWatcher to moniter a folder for
file drops. The service uses FileStream and StreamReader to read and process
the file. After it is done, the file is...
|
by: AdrianH |
last post by:
Assumptions
I am assuming that you know or are capable of looking up the functions I am to describe here and have some remedial understanding of C programming.
FYI
Although I have called this...
|
by: tshad |
last post by:
I am trying to get access to a file that may still being written because the
file is so large (7-10MB).
I get an error:
The process cannot access the file 'c:\TestDocs\XMLFiles\492172.XML'...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |