Saving to text file from WebService

  • Thread starter Thread starter BillG
  • Start date Start date
B

BillG

Hi,
I got a web service that I am writing an application to connect to it from,
what I need is code I can add to the web service that allows me to add
information to a text file located on the pc where the service is running.
This text file will be used to debug what information is being sent to and
from the web service.

Any help is appreciated.
Thanks
 
BillG said:
Hi,
I got a web service that I am writing an application to connect to it from,
what I need is code I can add to the web service that allows me to add
information to a text file located on the pc where the service is running.
This text file will be used to debug what information is being sent to
and from the web service.

Any help is appreciated.
Thanks

string logFile = Environment.ExpandEnvironmentVariables(
@"%SystemDrive%\WebSerivice.log");
using (System.IO.TextWriter file = System.IO.File.AppendText(logFile))
{
file.WriteLine("Debug information goes here.");
}
 
that's similar to what I was doing, but I am getting access is denied?
any ideas?

Have you made sure that your ASP.NET user (i.e. the user the code is
running as) has permission to write into the appropriate directory?

Jon
 
Back
Top