L
Laidbak
I seem to be getting an error saying I can't control services from an aspx page.
This code works:
private void Page_Load(object sender, System.EventArgs e)
{
/* Global Settings */
pcanywhereControl = new ServiceController("pcAnywhere Host Service");
/* put a title on the page */
TitleLabel.Text = pcanywhereControl.DisplayName.ToString();
StatusLabel.Text = pcanywhereControl.Status.ToString();
if (pcanywhereControl.Status.ToString() == "Running")
{
StartButton.Enabled = false;
}
else
{
StartButton.Enabled = true;
}
}
however, this code gives the following message:
"Cannot open awhost32 service on computer '.'."
private void Page_Load(object sender, System.EventArgs e)
{
/* Global Settings */
pcanywhereControl = new ServiceController("pcAnywhere Host Service");
/* put a title on the page */
TitleLabel.Text = pcanywhereControl.DisplayName.ToString();
StatusLabel.Text = pcanywhereControl.Status.ToString();
if (pcanywhereControl.Status.ToString() == "Running")
{
StartButton.Enabled = false;
}
else
{
StartButton.Enabled = true;
}
}
I need to be able to do this without running the asp.net user as
an administrator.
____________________________________
Wil Moore III, MCP | Integrations Specialist | Senior Consultant
DigitallySmooth Inc. | Quick Site Studio
This code works:
private void Page_Load(object sender, System.EventArgs e)
{
/* Global Settings */
pcanywhereControl = new ServiceController("pcAnywhere Host Service");
/* put a title on the page */
TitleLabel.Text = pcanywhereControl.DisplayName.ToString();
StatusLabel.Text = pcanywhereControl.Status.ToString();
if (pcanywhereControl.Status.ToString() == "Running")
{
StartButton.Enabled = false;
}
else
{
StartButton.Enabled = true;
}
}
however, this code gives the following message:
"Cannot open awhost32 service on computer '.'."
private void Page_Load(object sender, System.EventArgs e)
{
/* Global Settings */
pcanywhereControl = new ServiceController("pcAnywhere Host Service");
/* put a title on the page */
TitleLabel.Text = pcanywhereControl.DisplayName.ToString();
StatusLabel.Text = pcanywhereControl.Status.ToString();
if (pcanywhereControl.Status.ToString() == "Running")
{
StartButton.Enabled = false;
}
else
{
StartButton.Enabled = true;
}
}
I need to be able to do this without running the asp.net user as
an administrator.
____________________________________
Wil Moore III, MCP | Integrations Specialist | Senior Consultant
DigitallySmooth Inc. | Quick Site Studio