我有 xml 文件:
<?xml version="1.0" encoding="UTF-8"?>
<root lev="0">
content of root
<child1 lev="1" xmlns="root">
content of child1
</child1>
</root>
Run Code Online (Sandbox Code Playgroud)
和下一个代码:
XDocument xml = XDocument.Load("D:\\test.xml");
foreach (var node in xml.Descendants())
{
if (node is XElement)
{
MessageBox.Show(node.Value);
//some code...
}
}
Run Code Online (Sandbox Code Playgroud)
我收到消息:
child1 的 rootcontent 的内容
孩子1的内容
但我需要消息:
根的含量
孩子1的内容
如何修复它?
我在 WinForms 应用程序中使用该SetProcessDPIAware()函数。user32.dll调用后SetProcessDPIAware(),我需要返回到之前的DPI感知流程。
我阅读了文章设置进程的默认 DPI 感知。SetProcessDpiAwareness()并且SetProcessDpiAwarenessContext()不适用于 Windows 7 或 Windows Vista。
在调用某个进程后,如何返回到之前的 DPI 感知SetProcessDPIAware()?