0
下面我有一个应用程序初始化字符串的一部分:提取从Initializationstring值,并返回一个键值对
<Controls>
<HtmlElement name="lnkLogIn" type="HtmlElement">
<AttributeMatchPath matchtype="equals">
<href>JavaScript:void(0)</href>
<id>s_swepi_22</id>
</AttributeMatchPath>
</HtmlElement>
<InputElement name="tbPassword" type="InputElement">
<AttributeMatchPath matchtype="equals">
<id>s_swepi_2</id>
</AttributeMatchPath>
</InputElement>
<InputElement name="tbUserID" type="InputElement">
<AttributeMatchPath matchtype="equals">
<id>s_swepi_1</id>
</AttributeMatchPath>
</InputElement>
</Controls>
什么,我想在后面的代码做的是得到Inputelement名称和功能每个控件的id作为键值对,并返回一个字典对象或类似的东西,我们可以从中提取键值对信息。
这基本上是为了去除ID值的硬编码....所以一个通用的解决方案,从初始化字符串中获取元素名称和ID并将它们存储为键值对将非常好....感谢提前:)
PS:使用C#.....