File and 'Windows Service' access from Web Application
From: Cash Foley (news_at_cashfoley.com)
Date: 07/30/03
- Previous message: cppdev: "Re: How to get the private key from the certificate using .net"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 30 Jul 2003 10:16:57 -0700
I'm trying to start a Web Service from a Web Application
running on 2003 Server. The following code works fine
when run from a Windows Application but I get an Access
Denied exception when I attempt to run it from my Web App.
ServiceController[] services =
ServiceController.GetServices();
foreach(ServiceController service in services)
{
if(service.ServiceName == "ServiceName")
{
if(service.Status ==
ServiceControllerStatus.Stopped)
{
service.Start();
}
}
}
Similarly, I'm getting an Access Denied when streaming a
Text File with
using( StreamWriter writer = new StreamWriter(
configFile ) )
{
writer.Write("Some Text" );
}
Can anyone help me with this?
Thanks in advance,
Cash Foley
- Previous message: cppdev: "Re: How to get the private key from the certificate using .net"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|