다음 예제가 있고 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"?> <1 인당 $ 25,000> showvalue = "1 인당 25,000 달러"> AccidentMedicalCoverage> c : \\ xmlfile \ coverage.xml –
user1883676
무엇이'minvalue'와'maxvalue'입니까? XML에서 단 하나의 'value'속성 만 볼 수 있습니다. 왜 강력하게 타입이 지정된리스트 대신에'ArrayList'를 사용하고 있습니까? –