惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Tailwind CSS Blog
有赞技术团队
有赞技术团队
爱范儿
爱范儿
Engineering at Meta
Engineering at Meta
J
Java Code Geeks
雷峰网
雷峰网
WordPress大学
WordPress大学
L
LangChain Blog
D
DataBreaches.Net
The GitHub Blog
The GitHub Blog
博客园 - 三生石上(FineUI控件)
Microsoft Security Blog
Microsoft Security Blog
P
Proofpoint News Feed
腾讯CDC
GbyAI
GbyAI
罗磊的独立博客
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
F
Fortinet All Blogs
Y
Y Combinator Blog
V
V2EX
A
About on SuperTechFans

博客园 - づ韓じ懷飛→

基于Ajax的应用程序架构汇总 万年日历 - づ韓じ懷飛→ - 博客园 开发ASP.NET Atlas服务器端Extender控件——基本概念以及预先需求 在ASP.NET Atlas中创建自定义Behavior 为何XMLHttpRequest对象是AJAX的核心 使用Atlas简化客户端Ajax编程 .Net环境下基于Ajax的MVC方案(1) 用AJAX跟踪Google Adsense广告点击 Atlas—微软的Ajax工具包(初学者必看) GOOGLE地图自己建 asp.net将图片上传并存入SqlServer中 SQL宝典 群友 使用 Microsoft .NET 的企业解决方案模式 Ajax在.NET中与Server控件的交互 面 试 题 库 SQL Server 宝典 如何设置一个From的边界 一些.NET面试题
如何获取当前ASP.NET应用的认证模式
づ韓じ懷飛→ · 2006-04-30 · via 博客园 - づ韓じ懷飛→

NET 1.1里,

using System.Configuration;
using System.Web.Configuration;
using System.Reflection;


public AuthenticationMode GetAuthenticationMode()
{
 object auth = ConfigurationSettings.GetConfig("system.web/authentication");
 if (auth!= null)
 {
 //an internal class "System.Web.Configuration.AuthenticationConfig"
 Type t = auth.GetType();
 PropertyInfo pi = t.GetProperty("Mode",BindingFlags.Instance|BindingFlags.NonPublic);
 return (AuthenticationMode)pi.GetValue(auth,null);
  }

  return AuthenticationMode.None;
}


.NET 2.0里,

using System.Configuration;
using System.Web.Configuration;

public AuthenticationMode GetAuthenticationMode()
{
        Configuration config = WebConfigurationManager.OpenWebConfiguration("~");

        SystemWebSectionGroup swsg = (SystemWebSectionGroup)config.GetSectionGroup("system.web");

        AuthenticationSection auth = swsg.Authentication;
 return auth.Mode;
}