码迷,mamicode.com
首页 >  
搜索关键字:configurationmanager    ( 293个结果
单元测试之初试
研究了一周的单元测试,现在勉强算是摸到了门槛,现整理笔记如下: 项目架构是简单的工厂模式,对应代码为: DAL IDAL BLL DALFactory 最开始就卡在这里,一度以为静态方法无法单元测试,后来发现原因是因为ConfigurationManager.AppSettings["WebDAL" ...
分类:其他好文   时间:2016-07-18 16:47:57    阅读次数:185
【引用】C#读写app.config中的数据
读语句:          String str = ConfigurationManager.AppSettings["DemoKey"]; 写语句:            Configuration cfa = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);           cfa.AppSet...
分类:移动开发   时间:2016-07-13 17:02:00    阅读次数:265
C# WinForm程序添加引用后调用静态方法时报“Interfaces_Helper.Global”的类型初始值设定项引发异常。---> System.NullReferenceException: 未将对象引用设置到对象的实例。
出现原因: 因为Global类初始化某个静态变量时没有成功则会抛 System.NullReferenceException 异常,具体代码: public static string connstring = System.Configuration.ConfigurationManager.Co ...
分类:Windows程序   时间:2016-07-13 13:30:51    阅读次数:288
mvc webconfig appSettings 值获取、添加、修改实现
为了方便有时我们会把一些简单的配置的信息放入web.config文件里。 放到appSettings添加key value等信息。 var config= ConfigurationManager.AppSettings["minAmount"];//获取值 Configuration cfa = ...
分类:移动开发   时间:2016-06-30 14:14:53    阅读次数:242
连接数据库
private string connectionString; private void SaveCustomerInfo() { var entityConnStr = ConfigurationManager.ConnectionStrings["DcsEntities"].Connectio ...
分类:数据库   时间:2016-06-10 11:00:06    阅读次数:166
c#简单的SQLHelp
public abstract class SQLHelper { //只读的静态数据库连接字符串 //需添加引用System.Configuration; public static readonly string connString = ConfigurationManager.Connect ...
分类:数据库   时间:2016-05-30 17:15:06    阅读次数:244
SCCM TP4配置发现方法
SCCMTP4配置发现方法对于刚刚安装完成的SCCM服务器需要对其进行初始化的一些配置。SCCM发现会标识可使用ConfigurationManager管理的计算机和用户资源。它还可以发现环境中的网络基础结构。发现将为每个发现的对象创建发现数据记录(DDR),并将此信息存储在ConfigurationManager..
分类:其他好文   时间:2016-05-18 22:18:11    阅读次数:237
ASP.NET中的GridView自带的编辑更新功能
string ConStr = ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString; protected void Page_Load(object sender, EventArg ...
分类:Web程序   时间:2016-05-18 21:20:32    阅读次数:220
c# 调用sqlserver sp_send_dbmail 存储过程 发送邮件
<appSettings> <add key="MailProfile" value="AAA"/> </appSettings> private void btnSendMail() { try { string mailProfile = ConfigurationManager.AppSett ...
分类:数据库   时间:2016-04-21 18:39:00    阅读次数:212
将服务器文件压缩并下载
protected void BtnDowload_Click(object sender, EventArgs e) { string path = Server.MapPath(ConfigurationManager.AppSettings["PersonRecordUrl"]); strin ...
分类:其他好文   时间:2016-04-18 18:58:41    阅读次数:177
293条   上一页 1 ... 10 11 12 13 14 ... 30 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!