472,146 Members | 1,444 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,146 software developers and data experts.

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 13163


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
reply views Thread by Saiars | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.