0
我的解决方案中有一个名为“Voicecmd.xml”的文件,需要以编程方式写入。我怎么做?如何使用构建操作写入文件“Content”
代码用于更新/编辑voicecmd并在那里我卡住了...
async void updateall()
{
XDocument xDoc = XDocument.Load("voicecmd.xml");
var ns = XNamespace.Get("http://schemas.microsoft.com/voicecommands/1.0");
texb.Text = xDoc.Root.Element(ns + "CommandSet").Element(ns + "CommandPrefix").Value;
}
private async void ttcc(object sender, TextChangedEventArgs e)
{
XDocument xDoc = XDocument.Load("voicecmd.xml");
var ns = XNamespace.Get("http://schemas.microsoft.com/voicecommands/1.0");
xDoc.Root.Element(ns + "CommandSet").Element(ns + "CommandPrefix").Value = texb.Text;
// xDoc.Save(StreamWriter);
}
该文件正在讨论win8/rt。我需要WP8。 – Kevin
它应该是相似的 –
它似乎是。编辑代码时,唯一没有找到的是Windows.Storage.FileIO。 – Kevin