嗨,我有一個問題我有這樣的XML文件作爲我的配置文件在C#中創建一個新的XmlElement
<?xml version="1.0" encoding="utf-8"?>
<configs>
<config>
<starmade_path>null</starmade_path>
<gui_path>null</gui_path>
<first_start>true</first_start>
<dark_theme>false</dark_theme>
<light_theme>true</light_theme>
<OSM_theme>false</OSM_theme>
</config>
</configs>
如果它doesent文件中存在,所以我的XML文件,我需要先添加新元素看起來是這樣的
<?xml version="1.0" encoding="utf-8"?>
<configs>
<config>
<starmade_path>null</starmade_path>
<gui_path>null</gui_path>
<first_start>true</first_start>
<dark_theme>false</dark_theme>
<light_theme>true</light_theme>
<OSM_theme>false</OSM_theme>
<Red_theme>sampleText</Red_theme>
</config>
</configs>
謝謝,它完美^^ – Agronaut022
你是惠康 – Mostafiz