国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

在Asp.Net2.0中可以方便的訪問配置文件web.config

2024-07-10 13:10:44
字體:
來源:轉載
供稿:網友

asp.net2.0中我們可以方便的訪問配置文件中,.netframework2.0新增加了 systemwebsectiongroup 類。
允許用戶以編程方式訪問配置文件的 system.web 組。
比如判斷web.config內是否為 debug="true",或者判斷身份驗證形式

    systemwebsectiongroup ws = new systemwebsectiongroup();
    compilationsection cp = ws.compilation;
    用cp.debug;就可以得到compilation節內關于"debug"的配置
     authenticationsection  as = ws.authentication;
    用 as.mode  可以獲取 authentication節中關于"mode"的配置,值為authenticationmode 枚舉之一
authenticationmode的取值如下:
  成員名稱 說明
  forms 將基于 asp.net 窗體的身份驗證指定為身份驗證模式。 
  none 不指定身份驗證。 
  passport 將 microsoft passport 指定為身份驗證模式。 
  windows 將 windows 指定為身份驗證模式。在使用 internet 信息服務 (iis) 身份驗證方法(基本、簡要、集成 windows (ntlm/kerberos) 或證書)時適用此模式。 

    
附:systemwebsectiongroup 類的公共屬性:
  名稱  說明 
  anonymousidentification  獲取 anonymousidentification 節。
  authentication  獲取 authentication 節。
  authorization  獲取 authorization 節。
  browsercaps  獲取 browsercaps 節。
  clienttarget  獲取 clienttarget 節。
  compilation  獲取 compilation 節。
  customerrors  獲取 customerrors 節。
  deployment  獲取 deployment 節。
  devicefilters  獲取 devicefilters 節。
  globalization  獲取 globalization 節。
  healthmonitoring  獲取 healthmonitoring 節。
  hostingenvironment  獲取 hostingenvironment 節。
  httpcookies  獲取 httpcookies 節。
  httphandlers  獲取 httphandlers 節。
  httpmodules  獲取 httpmodules 節。
  httpruntime  獲取 httpruntime 節。
  identity  獲取 identity 節。
  isdeclarationrequired   獲取一個值,該值指示是否需要聲明此 configurationsectiongroup 對象。 (從 configurationsectiongroup 繼承。)
  isdeclared   獲取一個值,該值指示是否已聲明此 configurationsectiongroup 對象。(從 configurationsectiongroup 繼承。)
  machinekey  獲取 machinekey 節。
  membership  獲取 membership 節。
  mobilecontrols  獲取 mobilecontrols 節。
  name   獲取此 configurationsectiongroup 對象的名稱屬性。(從 configurationsectiongroup 繼承。)
  pages  獲取 pages 節。
  processmodel  獲取 processmodel 節。
  profile  獲取 profile 節。
  protocols  獲取 protocols 節。
  rolemanager  獲取 rolemanager 節。
  sectiongroupname   獲取與此 configurationsectiongroup 關聯的節組名稱。(從 configurationsectiongroup 繼承。)
  sectiongroups   獲取一個包含所有 configurationsectiongroup 對象的 configurationsectiongroup 對象,這些對象是此 configurationsectiongroup 對象的子對象。(從 configurationsectiongroup 繼承。)
  sections   獲取一個 configurationsectioncollection,它包含此 configurationsectiongroup 中的所有 configurationsection 對象。(從 configurationsectiongroup 繼承。)
  securitypolicy  獲取 securitypolicy 節。
  sessionstate  獲取 sessionstate 節。
  sitemap  獲取 sitemap 節。
  trace  獲取 trace 節。
  trust  獲取 trust 節。
  type   獲取或設置此 configurationsectiongroup 對象的類型。(從 configurationsectiongroup 繼承。)
  urlmappings  獲取 urlmappings 節。
  webcontrols  獲取 webcontrols 節。
  webparts  獲取 webparts 節。
  webservices  獲取 webservices 節。
  xhtmlconformance  獲取 xhtmlconformance 節。

  • 本文來源于網頁設計愛好者web開發社區http://www.html.org.cn收集整理,歡迎訪問。
  • 發表評論 共有條評論
    用戶名: 密碼:
    驗證碼: 匿名發表
    主站蜘蛛池模板: 怀化市| 交城县| 红原县| 积石山| 甘洛县| 玛纳斯县| 涟水县| 济阳县| 泰来县| 阿合奇县| 永宁县| 安龙县| 沙河市| 武义县| 镇原县| 张家口市| 修武县| 凤阳县| 普兰店市| 翁源县| 南岸区| 原阳县| 南漳县| 巩义市| 皋兰县| 庆云县| 绩溪县| 山丹县| 凤凰县| 育儿| 四川省| 镇沅| 南皮县| 玉龙| 金堂县| 青冈县| 工布江达县| 乐业县| 朝阳区| 宜宾县| 合水县|