zl程序教程

您现在的位置是:首页 >  后端

当前栏目

C#-ConfigurationManager类引用方法

c#方法 引用
2023-09-11 14:22:04 时间

C# 中的 ConfigurationManager类引用方法

2012年08月14日 16:13:39 isbnhao 

c#添加了Configuration;后,竟然找不到 ConfigurationManager 这个类,
后来才发现:虽然引用了using System.Configuration;这个包,但是还是不行的。
后来终于找到一个解决方法,就是在解决方案资源管理器里找到类文件选择“引用”,
然后右击选择“添加引用”,并且从 .net 中找到System.Configuration把它加上去就OK啦

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using System.Data.SqlClient;
using System.Configuration;

onfigurationManager.ConnectionStrings["northwind"].ConnectionString)