Web.config
Web.configから特定エレメントを抽出する
// Web.configが置いてあるディレクトリのパスを取得する。
var path = HostingEnvironment.ApplicationPhysicalPath;
// Web.configを開く。
Configuration webConfig = WebConfigurationManager.OpenMachineConfiguration(path);
// sessionStateエレメントを抽出する。
var config = (SessionStateSection) webConfig.GetSection("system.web/sessionState");