streamwriter

  • Thread starter Thread starter stringy
  • Start date Start date
S

stringy

Why could it be that i am able to use StreamWriter from a
windows application but not from a web application?

I am getting an unauthorizedaccessexception and the
exception message is "Access to the path... is denied".

the code i'm using is very straightforward:

using System.IO;
.....
StreamWriter sw = new StreamWriter(@"C:\Testing123.txt");
sw.Write("web");
sw.Close();

i am baffled.

Is this a security issue?

thank you in advance..
 
The Web application is executed under other credentials (the ASPNET user
account), which may lack privileges outside its temp folder.

BTW, this group is for VB.NET, not for C# ;-)

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 
Hello Stringly,

remember that in webapplications, your code is executed on the server.
So, in your example, are you sure which C-drive you are refering to???

Regards,

Q
 
Back
Top