访问被拒绝的路径[Windows 10]

时间:2017-04-26 11:24:46

标签: xml windows-10 edit access-denied

在C#windows应用程序中执行以下操作以解密和编辑xml文件,但总是得到“拒绝访问路径'C:\ Program Files \ ... \ Demo.xml'。”在Windows 10中保存文件。

                XmlDocument xmldoc = new XmlDocument();
                string xml_path = Utility.Decrypt_xml_files();
                xmldoc.Load(xml_path);

                //XmlNode xmlnode = xmldoc.SelectNodes("Programs/Code")[glbCard - 1];
                XmlNode xmlnode = xmldoc.GetElementsByTagName("Code")[glbCard - 1];
                xmlnode.SelectSingleNode("Revision").InnerText = txtRevision.Text;

                // save
                xmldoc.Save(xml_path);

0 个答案:

没有答案