الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

how to control IIS service from your web page

مغلق
بدأه stars في 20 مارس 2006 · 9 رد · 717 مشاهدة · في ASP.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

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

#2
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

logo.gif
استضافة ويندوز


اقتباس

مساحة تبدأ من 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

#3

i have this result when i try your code

Cannot open IISAdmin service on computer '.'.

#4
stars كتب:
i have this result when i try your code

Cannot 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

logo.gif
استضافة ويندوز


اقتباس

مساحة تبدأ من 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

#5

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 .

#6

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?

logo.gif
استضافة ويندوز


اقتباس

مساحة تبدأ من 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

#7

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 .

#8
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

logo.gif
استضافة ويندوز


اقتباس

مساحة تبدأ من 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

#9

dotnet 2003, framework 1.1

#10

I'v tested the code above and it is working fine.

Please copy/paste the exception that your getting exactly.

logo.gif
استضافة ويندوز


اقتباس

مساحة تبدأ من 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

هذا الموضوع مغلق.

مواضيع مشابهة