【发布时间】:2014-01-24 16:22:45
【问题描述】:
我需要从 web.config 文件中的连接字符串中获取服务器名称。我怎样才能解析出这个值?我尝试过拆分,但它不允许我在 = 符号上拆分。我该如何解析呢?
<add name ="Connection" connectionString="server=L\sqlexpress;database=System;User ID=TEst;Password=pass"></add>
我需要L\sqlexpress 我知道这看起来很简单,但我不明白。感谢您的帮助。
【问题讨论】:
-
你的意思是它不允许你在等号字符上分割?错误信息是什么?
标签: asp.net parsing connection-string