📜  从 web config c# 代码示例中获取连接字符串

📅  最后修改于: 2022-03-11 14:49:08.991000             🧑  作者: Mango

代码示例1
// Add a using directive at the top of your code file    
using System.Configuration;

// Within the code body set your variable    
string cs = ConfigurationManager.ConnectionStrings["connectionStringName"].ConnectionString;