我在我的 Web.config
文件中有以下部分:
<configSections>
<section name="mySection" type="myNameSpace, myProject"/>
</configSections>
<mySection>
<city id="ny" type="nameSpace1" />
<city id="dc" type="nameSpace2" />
<city id="nj" type="nameSpace3" />
</mySection>
我将循环遍历给定id的城市,并返回类型。即:
需要编写代码,通过id
循环遍历cities
并返回type
。
例如:
if the given id = "ny" --> return nameSpace1
if the given id = "dc" --> return nameSpace2
if the given id = "nj" --> return nameSpace3
type="myNameSpace, myProject"
一样。你如何填充该类型呢? - Oded