다음을 통해 공유


IAuthenticationModuleService.IsEnabled 메서드

정의

지정된 인증 모듈 서비스를 사용할 수 있는지 여부를 결정합니다.

public:
 bool IsEnabled();
public bool IsEnabled ();
abstract member IsEnabled : unit -> bool
Public Function IsEnabled () As Boolean

반환

true 인터페이스를 IAuthenticationModuleService 사용하도록 설정하면 이고, false그렇지 않으면 입니다.

예제

다음 예제에서는 Administration.config 파일에 정의된 인증 모듈 서비스를 확인하고 메서드 반환 값을 표시합니다 IsEnabled .

namespace ExtensibilityDemo
{
    public class DemoModuleService : ModuleService
    {
        [ModuleServiceMethod]
        public ArrayList GetSettings()
        {
            ArrayList settingList = new ArrayList();
            ServerManager manager = new ServerManager();
            ConfigurationElementCollection serverCollection;
            Configuration config = manager.GetAdministrationConfiguration();
            ConfigurationSection section = config.GetSection("moduleProviders");
            serverCollection = section.GetCollection();
            IAuthenticationModuleService authenticationModuleService;
            // Get all of the modules on the server. Filter the modules
            // to those of the IAuthenticationModuleService type.
            foreach (ConfigurationElement configurationElement in serverCollection)
            {
                // Add the authentication module service and the returned
                // IsEnabled value to the property bag for subsequent display.
                try
                {
                    // If the module service is other than an
                    // IAuthenticationModuleService an exception is thrown.
                    authenticationModuleService = (IAuthenticationModuleService)
                        ManagementUnit.GetModuleService(configurationElement.Attributes[0].Value.ToString());
                    PropertyBag settingBag = new PropertyBag();
                    settingBag[0] = authenticationModuleService.ToString();
                    settingBag[1] = authenticationModuleService.IsEnabled().ToString();
                    settingList.Add(settingBag);
                }
                catch
                {
                }
            }
            return settingList;
        }
    }
}

설명

이 방법을 사용하여 사이트에서 사용되는 인증 모듈 서비스를 확인할 수 있습니다.

적용 대상