partial class EditURLs
    {
        private System.ComponentModel.IContainer components = null;
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }
        #region Windows Form Designer generated code
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.button1 = new System.Windows.Forms.Button();
            this.textBox1 = new System.Windows.Forms.TextBox();
            this.button2 = new System.Windows.Forms.Button();
            this.button3 = new System.Windows.Forms.Button();
            this.button4 = new System.Windows.Forms.Button();
            this.timer1 = new System.Windows.Forms.Timer(this.components);
            this.comboBox1 = new System.Windows.Forms.ComboBox();
            this.SuspendLayout();
            this.button1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.button1.Location = new System.Drawing.Point(12, 415);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(75, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "保存";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            this.textBox1.Location = new System.Drawing.Point(12, 12);
            this.textBox1.Multiline = true;
            this.textBox1.Name = "textBox1";
            this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Both;
            this.textBox1.Size = new System.Drawing.Size(776, 397);
            this.textBox1.TabIndex = 1;
            this.button2.Enabled = false;
            this.button2.Location = new System.Drawing.Point(174, 415);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(75, 23);
            this.button2.TabIndex = 2;
            this.button2.Text = "等待获取";
            this.button2.UseVisualStyleBackColor = true;
            this.button2.Click += new System.EventHandler(this.button2_Click);
            this.button3.Location = new System.Drawing.Point(93, 415);
            this.button3.Name = "button3";
            this.button3.Size = new System.Drawing.Size(75, 23);
            this.button3.TabIndex = 3;
            this.button3.Text = "去重";
            this.button3.UseVisualStyleBackColor = true;
            this.button3.Click += new System.EventHandler(this.button3_Click);
            this.button4.Location = new System.Drawing.Point(713, 415);
            this.button4.Name = "button4";
            this.button4.Size = new System.Drawing.Size(75, 23);
            this.button4.TabIndex = 4;
            this.button4.Text = "返回";
            this.button4.UseVisualStyleBackColor = true;
            this.button4.Click += new System.EventHandler(this.button4_Click);
            this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
            this.comboBox1.FormattingEnabled = true;
            this.comboBox1.Location = new System.Drawing.Point(255, 418);
            this.comboBox1.Name = "comboBox1";
            this.comboBox1.Size = new System.Drawing.Size(120, 20);
            this.comboBox1.TabIndex = 22;
            this.comboBox1.Visible = false;
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(800, 450);
            this.Controls.Add(this.comboBox1);
            this.Controls.Add(this.button4);
            this.Controls.Add(this.button3);
            this.Controls.Add(this.button2);
            this.Controls.Add(this.textBox1);
            this.Controls.Add(this.button1);
            this.MinimizeBox = false;
            this.Name = "EditURLs";
            this.ShowIcon = false;
            this.ShowInTaskbar = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text = "编辑 节点池订阅链接";
            this.ResumeLayout(false);
            this.PerformLayout();
        }
        #endregion
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.TextBox textBox1;
        private System.Windows.Forms.Button button2;
        private System.Windows.Forms.Button button3;
        private System.Windows.Forms.Button button4;
        private System.Windows.Forms.Timer timer1;
        private System.Windows.Forms.ComboBox comboBox1;
    }

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace subs_check.win.gui
{
    public partial class MoreYAML : Form
    {
        string 初始化;
        public MoreYAML()
        {
            InitializeComponent();

            // 移除文本框的等待光标
            textBox1.UseWaitCursor = false;
            初始化 = textBox1.Text;

            // 设置 groupBox1 的 Anchor 属性，使其跟随窗体四边缩放
            groupBox1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;

            // 设置文本框跟随 groupBox1 缩放
            textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;

            // 设置 linkLabel1 固定在右上角
            linkLabel1.Anchor = AnchorStyles.Top | AnchorStyles.Right;

            // 设置按钮固定在底部
            button1.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
            button3.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
            button2.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;

            // 检查并加载配置文件
            LoadMoreYamlConfig();
        }

        /// <summary>
        /// 检查并加载 more.yaml 配置文件
        /// </summary>
        private void LoadMoreYamlConfig()
        {
            try
            {
                // 获取当前程序的执行路径
                string executablePath = System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath);
                // 指定config目录路径
                string configFolderPath = System.IO.Path.Combine(executablePath, "config");
                // 指定more.yaml文件的完整路径
                string moreYamlFilePath = System.IO.Path.Combine(configFolderPath, "more.yaml");

                // 检查文件是否存在
                if (System.IO.File.Exists(moreYamlFilePath))
                {
                    // 读取文件内容并赋值给textBox1
                    string yamlContent = System.IO.File.ReadAllText(moreYamlFilePath, Encoding.UTF8);
                    textBox1.Text = yamlContent;
                }
            }
            catch (Exception ex)
            {
                // 读取文件时出错，可以选择是否显示错误信息
                MessageBox.Show($"读取配置文件时发生错误：{ex.Message}", "提示",
                    MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start("https://github.com/beck-8/subs-check/blob/master/config/config.example.yaml");
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                // 验证textbox1的内容是否符合YAML格式
                if (!IsValidYaml(textBox1.Text))
                {
                    MessageBox.Show("输入的内容不符合YAML格式，请检查后重试！", "格式错误",
                        MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                // 获取当前程序的执行路径
                string executablePath = System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath);
                // 指定config目录路径
                string configFolderPath = System.IO.Path.Combine(executablePath, "config");
                // 指定more.yaml文件的完整路径
                string moreYamlFilePath = System.IO.Path.Combine(configFolderPath, "more.yaml");

                // 确保config目录存在
                if (!System.IO.Directory.Exists(configFolderPath))
                {
                    System.IO.Directory.CreateDirectory(configFolderPath);
                }

                // 将textBox1的内容写入more.yaml文件
                System.IO.File.WriteAllText(moreYamlFilePath, textBox1.Text, Encoding.UTF8);

                // 设置对话框结果为OK并关闭窗口
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show($"保存配置文件时发生错误：{ex.Message}", "错误",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        /// <summary>
        /// 验证字符串是否为有效的YAML格式
        /// </summary>
        /// <param name="yamlContent">要验证的YAML字符串</param>
        /// <returns>如果是有效的YAML格式，返回true；否则返回false</returns>
        private bool IsValidYaml(string yamlContent)
        {
            if (string.IsNullOrWhiteSpace(yamlContent))
                return true; // 空内容被视为有效（可以根据需要更改）

            try
            {
                // 使用YamlDotNet尝试解析YAML内容
                var deserializer = new YamlDotNet.Serialization.Deserializer();
                deserializer.Deserialize<object>(yamlContent);
                return true;
            }
            catch (YamlDotNet.Core.YamlException)
            {
                // 捕获YAML解析异常，表示格式无效
                return false;
            }
            catch (Exception)
            {
                // 其他异常也视为格式无效
                return false;
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            textBox1.Text = 初始化;
        }
    }
}

partial
class
EditURLs
{
private System.ComponentModel.IContainer components = null;
protected override void Dispose (bool disposing) {}
private void InitializeComponent () {}
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.ComboBox comboBox1;
}

This code segment functions to: Manage user interface elements for editing and processing URL lists through controls that enable text input, data deduplication, timed operations, and multiple action triggers while maintaining resource cleanup protocols.

```c_sharp
[TASK_BEGIN]
private void InitializeComponent()
{
    this.components = new System.ComponentModel.Container();
    this.button1 = new System.Windows.Forms.Button();
    this.textBox1 = new System.Windows.Forms.TextBox();
    this.button2 = new System.Windows.Forms.Button();
    this.button3 = new System.Windows.Forms.Button();
    this.button4 = new System.Windows.Forms.Button();
    this.timer1 = new System.Windows.Forms.Timer(this.components);
    this.comboBox1 = new System.Windows.Forms.ComboBox();
    this.SuspendLayout();
    //
    // button1
    //
    this.button1.Location = new System.Drawing.Point(258, 12);
    this.button1.Name = "button1";
    this.button1.Size = new System.Drawing.Size(75, 23);
    this.button1.TabIndex = 0;
    this.button1.Text = "Add";
    //
    // textBox1
    //
    this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    | System.Windows.Forms.AnchorStyles.Left)
    | System.Windows.Forms.AnchorStyles.Right)));
    this.textBox1.Location = new System.Drawing.Point(12, 41);
    this.textBox1.Multiline = true;
    this.textBox1.Name = "textBox1";
    this.textBox1.Size = new System.Drawing.Size(321, 190);
    this.textBox1.TabIndex = 1;
    //
    // button2
    //
    this.button2.Location = new System.Drawing.Point(258, 41);
    this.button2.Name = "button2";
    this.button2.Size = new System.Drawing.Size(75, 23);
    this.button2.TabIndex = 2;
    this.button2.Text = "Delete";
    //
    // button3
    //
    this.button3.Location = new System.Drawing.Point(258, 70);
    this.button3.Name = "button3";
    this.button3.Size = new System.Drawing.Size(75, 23);
    this.button3.TabIndex = 3;
    this.button3.Text = "Up";
    //
    // button4
    //
    this.button4.Location = new System.Drawing.Point(258, 99);
    this.button4.Name = "button4";
    this.button4.Size = new System.Drawing.Size(75, 23);
    this.button4.TabIndex = 4;
    this.button4.Text = "Down";
    //
    // timer1
    //
    this.timer1.Interval = 300;
    //
    // comboBox1
    //
    this.comboBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    | System.Windows.Forms.AnchorStyles.Right)));
    this.comboBox1.FormattingEnabled = true;
    this.comboBox1.Location = new System.Drawing.Point(12, 12);
    this.comboBox1.Name = "comboBox1";
    this.comboBox1.Size = new System.Drawing.Size(240, 21);
    this.comboBox1.TabIndex = 5;
    //
    // EditURLs
    //
    this.ClientSize = new System.Drawing.Size(345, 243);
    this.Controls.Add(this.comboBox1);
    this.Controls.Add(this.button4);
    this.Controls.Add(this.button3);
    this.Controls.Add(this.button2);
    this.Controls.Add(this.textBox1);
    this.Controls.Add(this.button1);
    this.ResumeLayout(false);
    this.PerformLayout();
}
[TASK_END]
```

private void InitializeComponent()
{
    this.components = new System.ComponentModel.Container();
    this.button1 = new System.Windows.Forms.Button();
    this.textBox1 = new System.Windows.Forms.TextBox();
    this.button2 = new System.Windows.Forms.Button();
    this.button3 = new System.Windows.Forms.Button();
    this.button4 = new System.Windows.Forms.Button();
    this.timer1 = new System.Windows.Forms.Timer(this.components);
    this.comboBox1 = new System.Windows.Forms.ComboBox();
    this.SuspendLayout();
    this.button1.Location = new System.Drawing.Point(258, 12);
    this.button1.Name = "button1";
    this.button1.Size = new System.Drawing.Size(75, 23);
    this.button1.TabIndex = 0;
    this.button1.Text = "Add";
    this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    | System.Windows.Forms.AnchorStyles.Left)
    | System.Windows.Forms.AnchorStyles.Right)));
    this.textBox1.Location = new System.Drawing.Point(12, 41);
    this.textBox1.Multiline = true;
    this.textBox1.Name = "textBox1";
    this.textBox1.Size = new System.Drawing.Size(321, 190);
    this.textBox1.TabIndex = 1;
    this.button2.Location = new System.Drawing.Point(258, 41);
    this.button2.Name = "button2";
    this.button2.Size = new System.Drawing.Size(75, 23);
    this.button2.TabIndex = 2;
    this.button2.Text = "Delete";
    this.button3.Location = new System.Drawing.Point(258, 70);
    this.button3.Name = "button3";
    this.button3.Size = new System.Drawing.Size(75, 23);
    this.button3.TabIndex = 3;
    this.button3.Text = "Up";
    this.button4.Location = new System.Drawing.Point(258, 99);
    this.button4.Name = "button4";
    this.button4.Size = new System.Drawing.Size(75, 23);
    this.button4.TabIndex = 4;
    this.button4.Text = "Down";
    this.timer1.Interval = 300;
    this.comboBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    | System.Windows.Forms.AnchorStyles.Right)));
    this.comboBox1.FormattingEnabled = true;
    this.comboBox1.Location = new System.Drawing.Point(12, 12);
    this.comboBox1.Name = "comboBox1";
    this.comboBox1.Size = new System.Drawing.Size(240, 21);
    this.comboBox1.TabIndex = 5;
    this.ClientSize = new System.Drawing.Size(345, 243);
    this.Controls.Add(this.comboBox1);
    this.Controls.Add(this.button4);
    this.Controls.Add(this.button3);
    this.Controls.Add(this.button2);
    this.Controls.Add(this.textBox1);
    this.Controls.Add(this.button1);
    this.ResumeLayout(false);
    this.PerformLayout();
}