public static void InitialConfig() { if (string.IsNullOrEmpty(UserDir)) { throw new ArgumentException("UserDir 尚未初始化"); } string filename = Path.Combine(UserDir, "settings.xml"); _config = ConfigSetting.Open(filename, true); #if NO try { _config = ConfigSetting.Open(filename, true); } catch (Exception ex) { MessageBox.Show($"配置文件 {filename} 装载失败:{ex.Message}"); _config = ConfigSetting.Create(filename); } #endif }