3
我有一個XML文件如何讀取XML創建的resx文件
<? xml version="1.0" encoding="utf-8"?>
<resources>
<string name="Foo">Bar</string>
<string name="Foo1">Bar1</string>
// More string Tags here
</resources>
我試圖
XMLTextReader reader = new XmlTextReader("FooBar.xml");
ResXResourceWriter writer = new ResXResourceWriter("FooBar.resx");
while(reader.Read())
{
if(reader.NodeType == XmlNodeType.Element && reader["name"] != null)
writer.AddResource("What_should_I_write_here", "What_should_I_write_here");
}
如何閱讀本XML,這樣我可以創造一個RESX文件。