<一>路径主要分为绝对路径和相对路径
    1.绝对路径
    主要注意C#中“\”是特殊字符,所以写绝对路径时候要改为“\”
    或者为了简化写法直接在路径前加上@
    string filePath=@”C:\Users\18333\Desktop\aaa.txt”;
    string filePath=””C:\Users\18333\Desktop\aaa.txt””;
    2.相对路径
    可以用
    string filePath=Application.StartupPath+”\filename.txt”;
    找到应用程序的可执行文件的路径
    以后可以保证拥有这个程序的硬件可以找到此文件。
    这个文件置于bin的Debug下
    <二>所有控件TextChanged触发事件
    1/我首先是把窗体中某一类型的控件都集合在自己定义的List,窗体一构造就执行
    即在窗体的构造函数里写
    public Form()
    {
    GetAllCertainControls(this,”NumericUpDown”,NumericControls);//注意初始化需要
    GetAllCertainControls(this, “CheckBox”,CheckBoxControls);//注意初始化需要
    }

    1. //新方法遍历所有NumericUpDown控件
    2. public static List<Control> NumericControls = new List<Control>();
    3. public static List<Control> CheckBoxControls = new List<Control>();
    4. //将特定类型的控件集合到定义好的List中
    5. private void GetAllCertainControls(Control control, string TypeName, List<Control> list)
    6. {
    7. string cTypeName = null;
    8. for (int i = 0; i < control.Controls.Count; i++)
    9. {
    10. cTypeName = control.Controls[i].GetType().Name;
    11. if (control.Controls[i].HasChildren && !(cTypeName == TypeName))
    12. {
    13. GetAllCertainControls(control.Controls[i], TypeName, list);
    14. }
    15. else if (cTypeName == TypeName)
    16. {
    17. list.Add(control.Controls[i]);
    18. }
    19. }
    20. }

    2.网上的一种方法是:
    先定义一个全局变量
    在想要得知的控件的TextChanged的事件里+1
    /??还想知道有没有其他办法