zoukankan      html  css  js  c++  java
  • Asp.net 读取config文件

    config:

    <?xml version="1.0"?>
    <appSettings>
      <!-- The path about dbConnectionString -->
      <add key="DBConnectionStringFile" value="D:\C3\config\Microsoft.Msn.Tokyo.DbConnectionString.xml"></add>
      
      <!-- The key to get c3ArticleDBConnectionString from dbConnectionstring -->
      <add key="ConnectionStringKey" value="SearchConnectionString"></add>
      
      </appSettings>


    读取:

      

    string dbXmlFileName = this.xmlDBConnectionStringFile;
                XmlDocument xmlD = new XmlDocument();
                xmlD.Load(dbXmlFileName);
                this.strSqlConn = xmlD.SelectSingleNode("/DBConnectionString/" + this.xmlConnectionStringKey).Attributes["value"].Value;
  • 相关阅读:
    2018CodeM复赛
    poj3683
    bzoj3991
    bzoj2809
    bzoj1001
    bzoj1412
    计蒜之道2018复赛
    HDU2255
    bzoj1010
    bzoj2006
  • 原文地址:https://www.cnblogs.com/2814/p/2773120.html
Copyright © 2011-2022 走看看