哪位兄弟用过exe.config吗!! 把这个文件Copy到实际运行的目录下不就行了么。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 以下代码是IDE自动生成的。我的程序在IDE中启动可以工作。如果从Windows 资源管理器中运行就会出错。说什么“System.Configuration.ConfigurationSettings”并不包含对“appSettings”的定义” System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader(); this.button1 = new System.Windows.Forms.Button(); this.SuspendLayout(); // // button1 // this.button1.Enabled = ((bool)(configurationAppSettings.GetValue("button1.Enabled", typeof(bool)))); ---调试发现出错是在句。也就是GetValue出错。 我的app.config文件如下(也是IDE自动生成的):<?xml version="1.0" encoding="utf-8"?><configuration> <appSettings> <!-- 此处显示用户应用程序和配置的属性设置。--> <!-- 示例:<add key="settingName" value="settingValue"/> --> <add key="button1.Enabled" value="True" /> </appSettings></configuration> C#数据库中遇到的问题。 急:c#发短信 绑定时出现服务器标记的格式不正确 winCE5.0下串口程序无法接收 读取word内容 并读取格式 傳多個不同的參數到sql中 关于随机函数 C# 串口通信 求助 VS.NET 2005 如何添加 Directx 的COM 组件啊 D3D and C# 高手求教 webform 怎么在页面dropdownlist中添加可选项目。 好着急,等待中,(数据库SQL2000,日期,DataTime)
System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Enabled = ((bool)(configurationAppSettings.GetValue("button1.Enabled", typeof(bool))));
---调试发现出错是在句。也就是GetValue出错。
我的app.config文件如下(也是IDE自动生成的):
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<!-- 此处显示用户应用程序和配置的属性设置。-->
<!-- 示例:<add key="settingName" value="settingValue"/> -->
<add key="button1.Enabled" value="True" />
</appSettings>
</configuration>