0
我有下面的例子,而c#就是我的草稿。你能告訴我如何調用的XML文件,並從中讀到這樣我就可以得到價值xml c#讀寫助手
public static ArrayList GetLocationLiabilityAmount()
{
ArrayList al = new ArrayList();
string selectedValue = Library.MovieClass.generalLibailityLocationLiability;
if (!String.IsNullOrEmpty(selectedValue))
{
if (option from xml == selectedValue)
{
al.Add(minvalue);
al.Add(maxvalue);
}
return al;
}
else
{
return null;
}
}
XML:
<?xml version="1.0" encoding="utf-8" ?>
<AccidentMedicalCoverage>
<coverage option="1" value="10000" showvalue="$10,000 per person"></coverage>
<coverage option="2" value="25000" showvalue="$25,000 per person"></coverage>
<coverage option="3" value="50000" showvalue="$50,000 per person"></coverage>
</AccidentMedicalCoverage>
<?XML版本=「1.0」編碼=「UTF-8」?> AccidentMedicalCoverage> c:\\ xmlfile \ coverage.xml –
user1883676
什麼是minvalue和maxvalue?我可以在你的xml中看到唯一的'value'屬性。你爲什麼使用'ArrayList'而不是強類型列表? –