Add application pool to the website
2010-07-28 19:03
267 查看
DirectoryEntry _RootFolder = new DirectoryEntry("IIS://localhost/W3SVC/1/ROOT");
DirectoryEntry _VirDir = _RootFolder.Children.Add(@"OKWeb", "IIsWebVirtualDir");
_VirDir.Properties["Path"].Value = @"C:\test"; //设置路径
_VirDir.Invoke("AppCreate", true);
//设置名称
_VirDir.Properties["AppFriendlyName"].Value = "OkWeb";
_VirDir.Properties["AppIsolated"].Value = 2;
_VirDir.CommitChanges();
_RootFolder.CommitChanges();
DirectoryEntry _VirDir = _RootFolder.Children.Add(@"OKWeb", "IIsWebVirtualDir");
_VirDir.Properties["Path"].Value = @"C:\test"; //设置路径
_VirDir.Invoke("AppCreate", true);
//设置名称
_VirDir.Properties["AppFriendlyName"].Value = "OkWeb";
_VirDir.Properties["AppIsolated"].Value = 2;
_VirDir.CommitChanges();
_RootFolder.CommitChanges();
相关文章推荐
- Add a custom tool to the web mapping application
- Add Console Application Program to the MFC Program
- Add new application to the main menu
- The service cannot be activated because it does not support ASP.NET compatibility. ASP.NET compatibility is enabled for this application. Turn off ASP.NET compatibility mode in the web.config or add the AspNetCompatibilityRequirements attribute to the ser
- Visual Studio 2008 Error: The web services enumeration components are not available. You need to reinstall Visual Studio to add web references to your application.
- You've implemented -[<UIApplicationDelegate> application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add "remote-notification" to the list of your supported UIBackgrou
- Dialog throwing "Unable to add window — token null is not for an application” with getApplication()
- How to add subview to a webview so that the subview would scroll along with webview?
- Apply a theme to an Activity or application
- Unable to add window -- token null is not for an application
- Android:Failed to allocate memory: 8;This application has requested the Runtime to terminate it ...
- Unable to complete the scan for annotations for web application [] due to a StackOverflowError
- This application is currently offline. To enable the application, remove the app_offline.htm file from the application root dire
- How to add dependency on a Windows Service AFTER the service is installed
- LeetCode 241. Different Ways to Add Parenthess 解题报告
- Gridview之RowCommand,ButtonField[add buttons and use the RowCommand event to add custom functionality to the control]
- 处理phonegap(cordova) application error the connection to the server was unsuccessful的错误
- sqlServer2012 sqlcmd:The application has failed to start because the side by side configuration
- Multiple substitutions specified in non-positional format; did you mean to add the formatted="false"
- This application is modifying the autolayout engine from a background thread, which can lead to engi