您的位置:首页 > 移动开发

在VB.NET 2005中取得APP.CONFIG中的字符串

2009-08-04 18:34 387 查看
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<sources>
<!-- 本部分定义 My.Application.Log 的登录配置-->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<!-- 取消以下部分的注释,以写入应用程序事件日志-->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information" />
</switches>
<sharedListeners>
<add name="FileLog"
type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
initializeData="FileLogWriter"/>
<!-- 取消以下部分的注释,并用应用程序名替换 APPLICATION_NAME,以写入应用程序事件日志-->
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
<appSettings>
<add key="ConnectionString" value="Server=(local);UID=sa;PWD=123456;DATABASE=ipcmd"/>
</appSettings>
</configuration>


MsgBox(System.Configuration.ConfigurationSettings.AppSettings("ConnectionString"))
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: