【C#】ConfigurationManager的使用

 

添加App.config文件

【C#】ConfigurationManager的使用_第1张图片

添加key和value



  
    
  

添加引用

添加System.Configuration引用

【C#】ConfigurationManager的使用_第2张图片

添加命名空间

using System.Configuration;

使用

string connectionString = ConfigurationManager.AppSettings["connectionString"];

 

你可能感兴趣的:(C#操作SqlServer)