Groups | Blog | Home
all groups > dotnet xml > november 2004 >

dotnet xml : Access Denied when trying to write to file via Web Service



SQLScott
11/24/2004 9:23:04 AM
Forgive me if this seems trivial but I cannot seem to find an answer. For
testing purposes, one of my methods in my Web Service writes to a file (at
least tries). I am using the following line of code to create the text file:

Dim sw As StreamWriter = New StreamWriter("c:\Accesstimes.txt")

But the error i get back when trying to execute this line of code is the
following:

Access to the path "c:\Accesstimes.txt" is denied

I am at a loss as to why the web service can't create and write to a file on
the local drive. Can anyone point me in the right direction?

Many thanks...
--
Thanks,

SQLScott
11/24/2004 12:23:03 PM
Thanks Martin,

while that wasn't exactly the answer, it certainly put me on the correct
path and I was able to solve the problem.

thanks for your help.

Scott

[quoted text, click to view]
Martin Honnen
11/24/2004 6:40:09 PM


[quoted text, click to view]

Well the web service probably runs on IIS and then under a certain
account for which you need to grant write access to that directory.
See
http://support.microsoft.com/?kbid=812614
for IIS 6 account names
--

Martin Honnen
Martin Honnen
11/24/2004 6:41:34 PM


[quoted text, click to view]

Also see this
http://www.aspfaq.com/show.asp?id=2039
for account settings.

--

Martin Honnen
AddThis Social Bookmark Button