/// <summary> /// 将配置信息保存到文件中 /// </summary> public static void SaveConfigsToFile() { var data = new IniParser.FileIniDataParser().ReadFile("v2tap.ini"); data["v2tap"]["TUNTAPAddress"] = Global.Configs.TUNTAPAddress; data["v2tap"]["TUNTAPGateway"] = Global.Configs.TUNTAPGateway; data["v2tap"]["TUNTAPNetmask"] = Global.Configs.TUNTAPNetmask; data["v2tap"]["TUNTAPDNS"] = Global.Configs.TUNTAPDNS; data["v2tap"]["TUNTAPMetric"] = Global.Configs.TUNTAPMetric.ToString(); data["v2tap"]["AutoAdapterMetric"] = Global.Configs.AutoAdapterMetric.ToString(); data["v2tap"]["AutoCheckAdapter"] = Global.Configs.AutoCheckAdapter.ToString(); data["v2tap"]["v2rayLoggingLevel"] = Global.Configs.v2rayLoggingLevel; File.WriteAllText("v2tap.ini", data.ToString()); }