//选择目录按钮事件 private void ChoiceDirButtonClick(object sender, RoutedEventArgs e) { Button button = sender as Button; string path = FileTools.OpenFolder(); if (path.Length > 4) { foreach (RelationStruct keyValue in texts) { if (keyValue.name == button.Name) { ((TextBox)keyValue.obj[0]).Text = path; return; } } } }