ApplicationPoolDefaults.AutoStart 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定值,指出應用程式集區是否在 IIS 啟動時自動啟動。
public:
property bool AutoStart { bool get(); void set(bool value); };
public bool AutoStart { get; set; }
member this.AutoStart : bool with get, set
Public Property AutoStart As Boolean
屬性值
true
如果應用程式集區應該自動啟動,則為 ;否則為 false
。 預設值為 true
。
範例
下列範例會 AutoStart 設定 屬性,並建立並認可新的應用程式集區。 此程式碼範例是針對 類別提供的較大範例的 ApplicationPoolDefaults 一部分。
Console.WriteLine("AutoStart:\t{0}",
manager.ApplicationPoolDefaults.AutoStart.ToString());
manager.ApplicationPoolDefaults.AutoStart = false;
manager.ApplicationPoolDefaults.Cpu.Limit = 26;
manager.ApplicationPoolDefaults.Recycling.PeriodicRestart.Time = TimeSpan.FromMinutes(1000);
// Create a new application pool.
ApplicationPoolCollection applicationPoolCollection = manager.ApplicationPools;
applicationPoolCollection.Add("new app pool");
// Commit the changes to ApplicationHost.config file.
manager.CommitChanges();
備註
的值 true
會向 World Wide Web Publishing Service (WWW 服務) 應用程式集區應該在建立時或 IIS 啟動時自動啟動。