If (!String.Equals(value, keyValues, StringComparison.OrdinalIgnoreCase))ĭim serverManager As ServerManager = New ServerManagerĭim config As Configuration = serverManager.GetApplicationHostConfigurationĭim sitesSection As ConfigurationSection = config.GetSection("system.applicationHost/sites")ĭim sitesCollection As ConfigurationElementCollection = sitesSection.GetCollectionĭim siteElement As ConfigurationElement = FindElement(sitesCollection, "site", "name", "mySite") Object o = element.GetAttributeValue(keyValues) If (String.Equals(element.ElementTagName, elementTagName, StringComparison.OrdinalIgnoreCase))įor (int i = 0 i < keyValues.Length i += 2) Private static ConfigurationElement FindElement(ConfigurationElementCollection collection, string elementTagName, params string keyValues)įoreach (ConfigurationElement element in collection) Execute the method to start the FTP site. Create an instance of the Start method.ĬonfigurationMethodInstance Start = () Create an object for the ftpServer element.ĬonfigurationElement ftpServerElement = siteElement.GetChildElement("ftpServer") Using (ServerManager serverManager = new ServerManager())Ĭonfiguration config = serverManager.GetApplicationHostConfiguration() ĬonfigurationSection sitesSection = config.GetSection("system.applicationHost/sites") ĬonfigurationElementCollection sitesCollection = sitesSection.GetCollection() ĬonfigurationElement siteElement = FindElement(sitesCollection, "site", "name", (siteElement = null) throw new InvalidOperationException("Element not found!") The following examples enable you to start an FTP site programmatically. The site-specific element is configured at the site-level. In the Manage Website section of the Actions pane, click Start. In the Connections pane, expand the server name, expand the Sites node, and then click the name of the FTP site. Double-click Administrative Tools, and then double-click Internet Information Services (IIS) Manager.On the taskbar, click Start, and then click Control Panel.If you are using Windows Vista or Windows 7: On the taskbar, click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.If you are using Windows Server 2008 or Windows Server 2008 R2: Click Administrative Tools, and then double-click Internet Information Services (IIS) Manager. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |