dear all,
i need to control my iis services from my web page, i need to have a page that contain 1 button, when i press that iis service will be stoped.
thanks
dear all,
i need to control my iis services from my web page, i need to have a page that contain 1 button, when i press that iis service will be stoped.
thanks
stars كتب:dear all,i need to control my iis services from my web page, i need to have a page that contain 1 button, when i press that iis service will be stoped.
thanks
Try this and make sure adding a reference to System.ServiceProcess in your web application
Dim Proc As New System.ServiceProcess.ServiceController("IISAdmin")
Try
Proc.Stop()
Catch ex As Exception
Response.write(ex.message")
End Tryاقتباسمساحة تبدأ من 2000 ميجا بايت بسعر 1.99 دولار شهريا.ا
اقتباسASP.NET 1.1-2.0-3.0-3.5-4.0-4.5.1 / MVC ASP.NET / PHP 5.x / ColdFusion / MSSQL 2008 & 2012 / MYSQL
i have this result when i try your code
Cannot open IISAdmin service on computer '.'.
stars كتب:i have this result when i try your codeCannot open IISAdmin service on computer '.'.
You should specify the exact service name in the code.
Go to
Control panel | Administrative tools | Services | and check the iisadmin name there
Let me know if you need further help.
Regards
اقتباسمساحة تبدأ من 2000 ميجا بايت بسعر 1.99 دولار شهريا.ا
اقتباسASP.NET 1.1-2.0-3.0-3.5-4.0-4.5.1 / MVC ASP.NET / PHP 5.x / ColdFusion / MSSQL 2008 & 2012 / MYSQL
i try all you sayed to me bout i have same result . but when i apply all your steps in win app. the test is successed , i don't know why fail with web app.
thanks .
Did you add the System.ServiceProcess reference?
What is the error that you was getting?
Looks like it is a security exception, isn't it?
اقتباسمساحة تبدأ من 2000 ميجا بايت بسعر 1.99 دولار شهريا.ا
اقتباسASP.NET 1.1-2.0-3.0-3.5-4.0-4.5.1 / MVC ASP.NET / PHP 5.x / ColdFusion / MSSQL 2008 & 2012 / MYSQL
yea, i add reference and have this error
<< Cannot open IISAdmin service on computer '.'. >>
that is mean that my code is right but code in web page can't control over service .but in win app when i try all that code the test is successed .
stars كتب:yea, i add reference and have this error<< Cannot open IISAdmin service on computer '.'. >>
that is mean that my code is right but code in web page can't control over service .but in win app when i try all that code the test is successed .
Let me know your .NET version. I'll tell how to figure it out by modifing the machine.config
اقتباسمساحة تبدأ من 2000 ميجا بايت بسعر 1.99 دولار شهريا.ا
اقتباسASP.NET 1.1-2.0-3.0-3.5-4.0-4.5.1 / MVC ASP.NET / PHP 5.x / ColdFusion / MSSQL 2008 & 2012 / MYSQL
dotnet 2003, framework 1.1
I'v tested the code above and it is working fine.
Please copy/paste the exception that your getting exactly.
اقتباسمساحة تبدأ من 2000 ميجا بايت بسعر 1.99 دولار شهريا.ا
اقتباسASP.NET 1.1-2.0-3.0-3.5-4.0-4.5.1 / MVC ASP.NET / PHP 5.x / ColdFusion / MSSQL 2008 & 2012 / MYSQL
هذا الموضوع مغلق.