我有以下示例,c# 只是我的草稿。你能告诉我如何调用 xml 文件并在那里读取,这样我就可以获得值
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>