Go homepage(回首页) Upload pictures (上传图片) Write articles (发文字帖)
The author:(作者)delvpublished in(发表于) 2014/1/6 9:11:02 在ASP.NET2.0中的WEB.CONFIG文件中调用外部文件_[Asp.Net教程]
"data source=.\sqlexpress;initial catalog=northwind;integrated security=true"providerName="System.Data.SqlClient"/>
再建立一个developerappsetingstring.xml如下
type="System.Web.Security.SqlMembershipProvider"connectionStringName="connstr"/>
同样道理,可以在test目录下,也建立相关类似的xml文件,然后,在web.config中,可以这样调用了
configSource="developer\developerconnectionstring.xml" />configSource="developer\developermembership.xml"/>
可以看到,在web.config中,可以通过configsource属性来读取外部文件
jackyrong BLOG
赞