Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 24th, 2005, 10:57 AM
Registered User
 
Join Date: Mar 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Stop Service via aspx-site

Hi i created an aspx-File with some simple code to stop the Alerter-Service on Win2k3:

Code:
<% System.ServiceProcess.ServiceController sc = new 
System.ServiceProcess.ServiceController("Alerter"); 
sc.Stop(); %>
But this error confuses me:

Quote:
quote:Compiler Error Message: BC30456: 'ServiceProcess' is not a member of 'System'.

Source Error:
Line 1: <% System.ServiceProcess.ServiceController sc = new
Line 2: System.ServiceProcess.ServiceController("Alerter") ;
Line 3: sc.Stop(); %>
any suggestions?
 
Old March 24th, 2005, 04:44 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Probably an assembly reference is missing, try writing your code within the

<script runat="server">

</script>

Element instead, because ASP.NET isn't meant to use <% %> in that approach.

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop Tomcat Service "Command Window" steveAR BOOK: Professional Apache Tomcat 1 June 9th, 2008 12:16 PM
Rename web site, aspx, folder in VS 2005? cJeffreywang BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 0 July 9th, 2007 11:40 AM
IIS Service Unavailable -- >.aspx not recognized [email protected] ASP.NET 1.0 and 1.1 Professional 3 August 9th, 2006 10:38 AM
aspx site works local, but not on FTP host(?) zuz29 ASP.NET 1.0 and 1.1 Basics 1 June 2nd, 2006 08:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.