/// <summary> /// 添加网络节点 /// </summary> /// <param name="config"> /// config对象 /// </param> /// <param name="Node"> /// PROXY类型对象 /// </param> /// <returns></returns> public bool AddNode(Config config, PROXY Node) { try { config.Proxy.Add(Node); yaml.Change(config); return(true); } catch (Exception) { return(false); } }
/// <summary> /// 修改节点信息 /// </summary> /// <param name="config"> config对象</param> /// <param name="Node">PROXY对象</param> /// <returns>返回成功与否</returns> public bool ChangeNode(Config config, PROXY Node) { try { foreach (PROXY N in config.Proxy) { if (N.name == Node.name) { config.Proxy[config.Proxy.IndexOf(N)] = Node; } } yaml.Change(config); return(true); } catch (Exception) { return(false); } }