Usually "access denied" is resolved by giving permissions to the appropriate
account.
In your case it's ASPNET account... needs to have "Read" permissions.
Also change this
dim fs as new io.filestream(server.mappath("test\1.txt"),filemod e.open)
to
dim fs as new io.filestream(server.mappath("test\1.txt"),filemod e.open,
FileAccess.Read)
otherwise it will require write/modify permissions as well
George.
"Quinn" <qj**@yahoo.comwrote in message
news:el****************@TK2MSFTNGP06.phx.gbl...
Hi,
I add a folder to my web application, the folder name is "Text" and I put
one text file (1.txt) in the folder. in Default.aspx.vb load event, I try
to open this text file:
dim fs as new io.filestream(server.mappath("test\1.txt"),filemod e.open)
dim sr as new io.streamreader(fs)
dim s as string=sr.readtoend
sr.close
response.write (s)
I got a error saying "access to path <pathis denied".
How do I resolve this problem?
Regards
Quinn