10 August, 2010
0 Comments
1 category
If you want to find or get an element from a generic list or collection with LINQ and C#, you can use the "First" function:
public ApplicationPool GetApplicationPoolByName(string name) { ApplicationPool applicationPool; using (ServerManager manager = new ServerManager()) { applicationPool = manager.ApplicationPools.First(a => a.Name == name); } return applicationPool; }
You can find the Microsoft.Web.Administration.dll in "%windir%\System32\inetsrv".
Category: Uncategorized