469,356 Members | 2,055 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,356 developers. It's quick & easy.

Access Denied when trying to write to file via Web Service

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,

Scott
Nov 12 '05 #1
3 13033


SQLScott wrote:
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?


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
http://JavaScript.FAQTs.com/
Nov 12 '05 #2


SQLScott wrote:
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?


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

--

Martin Honnen
http://JavaScript.FAQTs.com/
Nov 12 '05 #3
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

"Martin Honnen" wrote:


SQLScott wrote:
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?


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

--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Thomas Thomas | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.