|
-
May 28th, 2008, 04:46 AM
#1
strange issue, can not control servicecontroller on my pc
Hi all
Today I met one strange issue. When I used vs2005 to build a website, I can use this to control the remote server's windows service. My code looks like this:
public bool IsPublisherServiceRunning(string strPublisherServiceName)
{
bool bResult = false;
ServiceController controller = new ServiceController(strPublisherServiceName, this.m_publisherHost);
if (controller.Status == ServiceControllerStatus.Running)
{
bResult = true;
}
return bResult;
}
in the debug mode, it works well.
but, after I published the website to some directory on the same server with the source using build->publish website. it reports the error message:
"Cannot open Service Control Manager on computer '10.85.6.166'. This operation might require other privileges."
it is so strange. does someone meet the same issue before? could you please give me some tips on this.
many thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|