希格工作室

2011年7月21日 星期四

取得目前Web.config的驗證狀態

        剛才google半天找不到,終於被我想出來,也許很多人都知道,不過我之前都沒想過這問題,所以不知道。

        趁發現新大陸,趕緊記下吧。


           System.Web.Configuration.AuthenticationSection configSection =
                (System.Web.Configuration.AuthenticationSection)System.Web.Configuration.WebConfigurationManager.GetWebApplicationSection("system.web/authentication");
            TextBox2.Text = configSection.Mode.ToString();

沒有留言:

張貼留言