n中的如下XML形式獲取特定類型的innertag的值在字符串或變量,要使用XmlDocument的
<?xml version="1.0" encoding="utf-8"?>
<Models>
<Model DESC="HONDA-BLUE-450" MODELID="XX12-01" Status="in" />
<Model DESC="VOLKS--RED-345" MODELID="XY12-01" Status="in" />
<Model DESC="BENZ-BLUE-550" MODELID="XX12-01" Status="in" />
<Model DESC="VOLKS--CYAN-345" MODELID="BG12-01" Status="out" />
<Model DESC="HONDA-GREEN-234" MODELID="AX12-01" Status="in" />
<Model DESC="VOLKS-Yellow-765" MODELID="XY11-01" Status="in" />
<Model DESC="HONDA-GREEN-109" MODELID="AC12-01" Status="in" />
<Model DESC="AUDI-GREEN-984" MODELID="AF42-01" Status="in" />
<Model DESC="VOLKS-Yellow-565" MODELID="XJ11-61" Status="out" />
<Model DESC="HONDA-WHITE-079" MODELID="DC12-38" Status="in" />
<Model DESC="TOYOTA-GREY-109" MODELID="UC12-81" Status="in" />
<Model DESC="AUDI-CYAN-984" MODELID="LF42-41" Status="in" />
<Model DESC="VOLKS-WHITE-865" MODELID="LK11-61" Status="out" />
<Model DESC="HONDA-GREY-039" MODELID="PC12-31" Status="in" />
</Models>
我想所有的MODELID值,其地位並DESC與VOLKS開始。任何幫助,將不勝感激。
看這個問題http://stackoverflow.com/questions/21399599/reading-a-particular-config-element-using-c/21401100#21401100 –