Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
WebConfigurationManager này cũng hỗ trợ các phương pháp sau:. GetSection-Lấy một phần cấu hình tương đối so với các trang hiện tại hoặc một con đường cung cấp ảo. . GetWebApplicationSection-Lấy một phần cấu hình từ tập tin ứng dụng web gốc hiện tại cấu hình web. | 1524 CHAPTER 34 Configuring Applications The WebConfigurationManager also supports the following methods GetSection Retrieves a configuration section relative to the current page or a supplied virtual path. GetWebApplicationSection Retrieves a configuration section from the current web application root web configuration file. OpenMachineConfiguration Retrieves a Machine.config file on either the local machine or a remote server. OpenMappedMachineConfiguration Retrieves a Machine.config file by using a particular file mapping. OpenMappedWebConfiguration Retrieves a web configuration file by using a particular file mapping. OpenWebConfiguration Retrieves a Web.config file on either the local machine or a remote server. Almost every configuration section in the web configuration file has a corresponding class in .NET Framework that represents the configuration section. These classes provide you with a strongly typed representation of each configuration section. For example corresponding to the authentication section in the web configuration file there is a System.Web.Configuration.AuthenticationSection class. Corresponding to the pages section in the web configuration file there is a System.Web.Configuration.PagesSection class. Each of these classes expose properties that correspond to all the attributes you can set in the web configuration file. Reading Configuration Sections from the Current Application When an ASP.NET application starts the application merges all the configuration settings in the configuration hierarchy to create one representation of the configuration settings. A particular configuration setting might have different values at different levels in the hierarchy. You can use the methods of the WebConfigurationManager class to get the value of a configuration setting at any level in the hierarchy. The WebConfigurationManager.GetWebApplicationSection method always retrieves a configuration setting from the application root Web.config file. For example