VC++2005 WINFORM app.config

 调用方法:

1.设置

 

 

2.static System::String ^constr=System::Configuration ::ConfigurationManager ::AppSettings ["con"]->ToString ();取值

3.app.config内容如下:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
 <appSettings>
  <add key ="con" value ="server=192.168.52.12;uid=sa;pwd=sa123456;database=计算机文化基础;Connect Timeout=500;"/>
  <add key ="serverfile" value ="http://192.168.52.12//SERVER//"/>
 </appSettings>
</configuration>

 引自:http://social.msdn.microsoft.com/Forums/zh-CN/vclanguage/thread/2f4e999f-37e6-436b-9a39-cf593e5308d3

First check if your configuration file appears renamed in output directory near your executable. Unlike C#, in C++ this file does not seem to be copied automatically.

 

If you did not yet set the copying operation, then right click on App.config file in Solution Explorer, go to Custom Build Step and type:

 

·         In Command Line field:

 

              copy "$(InputPath)" "$(TargetPath).config"

 

·         In Outputs field:

 

              $(TargetPath).config

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值